Jump to content
  • 0

Comanda /givegun


WiDuAlK

Question

Nick:WiDuAlK

Problema:comanda /givegun

Erori / warnings: nu are dar as vrea sa pun la aceasta comanda si bazuka si tunul cu id 36

Lini/script:[pawn] if(strcmp(cmd, "/givegun", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [arma id (eg. 46 = Parachute)] [gloante]");

return 1;

}

new playa;

new gun;

new ammo;

playa = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

gun = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [weaponid] [ammo]");

SendClientMessage(playerid, COLOR_GRAD4, "3(Golf club) 4 (Knife) 5 (Lilieci) 6 (Shovel) 7 (Copie) 8 (Katana) 10-13 (Dildo) 14 (Flowers) 16 (Grenati) 18 (Molotovs) 22 (9mm pistol) 23 (SPistol)");

SendClientMessage(playerid, COLOR_GRAD3, " 24 (Shotgun) 29 (MP5) 30 (AK47) 31 (M4) 33 (Pusca) 34 (Sniper) 35 (Bazuka) 37 (Flame-thrower) 41 (Spray) 43 (Camera) 46(Parachute)");

return 1;

}

if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==35||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45)

{ SendClientMessage(playerid, COLOR_GRAD1, "  Id-ul armei este invalid!"); return 1; }

tmp = strtok(cmdtext, idx);

ammo = strval(tmp);

if(ammo <1||ammo > 9999999999)

{ SendClientMessage(playerid, COLOR_GRAD1, "  Nu mai putin de 1 si mai mult de 999999999999 gloante!"); return 1; }

if (PlayerInfo[playerid][pAdmin] >= 7)

{

    if(IsPlayerConnected(playa))

    {

        if(playa != INVALID_PLAYER_ID)

        {

ServerGivePlayerWeapons(playa, gun, ammo);

}

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Tu nu ai acces la aceasta comanda!");

}

}

return 1;

}[/pawn]

Ai incercat sa rezolvi singur ?:DA

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Fi atent ,acolo unde ai if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==35||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45)

sterge tot si scrie doar  if(gun < 1||gun > 46) o sa iti mearga toate armele

Daca nu te descurci sterge comanda ta si baga asta :

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

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [arma id (eg. 46 = Parachute)] [gloante]");

return 1;

}

new playa;

new gun;

new ammo;

playa = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

gun = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [weaponid] [ammo]");

SendClientMessage(playerid, COLOR_GRAD4, "3(Golf club) 4 (Knife) 5 (Lilieci) 6 (Shovel) 7 (Copie) 8 (Katana) 10-13 (Dildo) 14 (Flowers) 16 (Grenati) 18 (Molotovs) 22 (9mm pistol) 23 (SPistol)");

SendClientMessage(playerid, COLOR_GRAD3, " 24 (Shotgun) 29 (MP5) 30 (AK47) 31 (M4) 33 (Pusca) 34 (Sniper) 35 (Bazuka) 37 (Flame-thrower) 41 (Spray) 43 (Camera) 46(Parachute)");

return 1;

}

if(gun < 1||gun > 46)

{ SendClientMessage(playerid, COLOR_GRAD1, "  Id-ul armei este invalid!"); return 1; }

tmp = strtok(cmdtext, idx);

ammo = strval(tmp);

if(ammo <1||ammo > 9999999999)

{ SendClientMessage(playerid, COLOR_GRAD1, "  Nu mai putin de 1 si mai mult de 999999999999 gloante!"); return 1; }

if (PlayerInfo[playerid][pAdmin] >= 7)

{

    if(IsPlayerConnected(playa))

    {

        if(playa != INVALID_PLAYER_ID)

        {

ServerGivePlayerWeapons(playa, gun, ammo);

}

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Tu nu ai acces la aceasta comanda!");

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

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

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [arma id (eg. 46 = Parachute)] [gloante]");

return 1;

}

new playa;

new gun;

new ammo;

playa = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

gun = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[iNFO]:{ffffff} /givegun [Player id] [weaponid] [ammo]");

SendClientMessage(playerid, COLOR_GRAD4, "3(Golf club) 4 (Knife) 5 (Lilieci) 6 (Shovel) 7 (Copie) 8 (Katana) 10-13 (Dildo) 14 (Flowers) 16 (Grenati) 18 (Molotovs) 22 (9mm pistol) 23 (SPistol)");

SendClientMessage(playerid, COLOR_GRAD3, " 24 (Shotgun) 29 (MP5) 30 (AK47) 31 (M4) 33 (Pusca) 34 (Sniper) 35 (Bazuka) 37 (Flame-thrower) 41 (Spray) 43 (Camera) 46(Parachute)");

return 1;

}

if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==38||gun==39||gun==40||gun==44||gun==45)

{ SendClientMessage(playerid, COLOR_GRAD1, "  Id-ul armei este invalid!"); return 1; }

tmp = strtok(cmdtext, idx);

ammo = strval(tmp);

if(ammo <1||ammo > 9999999999)

{ SendClientMessage(playerid, COLOR_GRAD1, "  Nu mai putin de 1 si mai mult de 999999999999 gloante!"); return 1; }

if (PlayerInfo[playerid][pAdmin] >= 7)

{

    if(IsPlayerConnected(playa))

    {

        if(playa != INVALID_PLAYER_ID)

        {

ServerGivePlayerWeapons(playa, gun, ammo);

}

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Tu nu ai acces la aceasta comanda!");

}

}

return 1;

}[/pawn]

7bdea99b11.png

rimmon curv.

Link to comment
Share on other sites

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.