eh command error
#1

i have made a command /rocket this gives player a rocket launcher with 10 ammo but when they repeat command they get 10 ammo again so they get 20 ammo how to stop this and i want players who use command /rocket cost them $10,000
Reply
#2

Give us the code you made so far.
Reply
#3

Thats gona happend every time because each time they will do /rocket then they will get 20 ammo like they got 2 rockets.
Reply
#4

after the giveplayerweapon put this:
pawn Код:
SetPlayerAmmo(playerid,35,10);//set the ammo to 10
GivePlayerMoney(playerid, -10000);//take his money
Reply
#5

command i made so far

if (strcmp("/rocket", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,35,10);
SendClientMessage(playerid, 0x00FF00FF, "You've Spawned a Rocket Launcher!");
return 1;
}
Reply
#6

pawn Код:
if(!strcmp("/rocket", cmdtext, true))
 {
     if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1, "You dont have $10000");
     GivePlayerWeapon(playerid,35,10);
     SendClientMessage(playerid, 0x00FF00FF, "You've Spawned a Rocket Launcher!");
     SetPlayerAmmo(playerid,35,10);//set the ammo to 10
     GivePlayerMoney(playerid, -10000);//take his money
     return 1;
 }
Reply
#7

thx Pharrel added to ur repo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)