Jump to content

Recommended Posts

Posted

Nume: Sampxd

Nume tutorial: Skin range

Descriere: salut as vrea sa imi creati un tutorial cum sa fac comanda /skinrange , adica cand dau /skinrange [range] [idskin] sa dea skin la toti jucatoru , (skinu care lam selectat eu) pe o distanta de x metri

Posted

Uite aici:

[pawn]if(strcmp(cmd, "/skinrange", true) == 0)

{

if(IsPlayerConnected(playerid))

{

    if(PlayerInfo[playerid][pAdmin] >= 1) // sa fie doar pentru admini

    {

        new dist; // variabila pentru distanta

  tmp = strtok(cmdtext, idx);

dist = strval(tmp);

if(dist < 1)

{

    SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: {FFFFFF}/skinrange [range] [skin]");

    return 1;

}

if(dist > 100) // distanta maxima sa fie de 100m

{

SendClientMessage(playerid, COLOR_LIGHTRED, "* Distanta maxima este de 100 metri !");

return 1;

}

new skin; // variabila pt skin

tmp = strtok(cmdtext, idx);

skin = strval(tmp);

new acpl; // variabila pentru numaratoare

GetPlayerName(playerid, sendername, sizeof(sendername)); // aflarea numelui care executa comanda

for(new [censured by the system] = 0; [censured by the system] < MAX_PLAYERS; [censured by the system]++)

{

    acpl++;

    new Float:x,Float:y,Float:z;

    GetPlayerPos(playerid, x,y,z);

    if(PlayerToPoint(dist, [censured by the system],x,y,z))

    {

        SetPlayerSkin([censured by the system], skin);

        format(string, sizeof(string), "[skinRange]: Admin %s ti'a setat skin'ul cu ID %d", sendername, skin);

        SendClientMessage([censured by the system], COLOR_WHITE, string);

}

}

format(string, sizeof(string), "AdmInfo: {FFFFFF}Admin %s a folosit comanda /skinrange(actionata pe %d playeri).", sendername, acpl);

ABroadCast(COLOR_LIGHTRED, string, 1);

}

else

{

    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Error: {FFFFFF}Nu esti autorizat sa folosesti aceasta comanda !");

    return 1;

}

}

return 1;

}[/pawn]

Sper sa'ti foloseasca ! Succes !

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.