eh command error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: eh command error (
/showthread.php?tid=291335)
eh command error -
jiwan - 19.10.2011
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
Re: eh command error -
Drebin - 19.10.2011
Give us the code you made so far.
Re: eh command error -
nilanjay - 19.10.2011
Thats gona happend every time because each time they will do /rocket then they will get 20 ammo like they got 2 rockets.
Re: eh command error -
Pharrel - 19.10.2011
after the giveplayerweapon put this:
pawn Код:
SetPlayerAmmo(playerid,35,10);//set the ammo to 10
GivePlayerMoney(playerid, -10000);//take his money
Re: eh command error -
jiwan - 19.10.2011
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;
}
Re: eh command error -
Pharrel - 19.10.2011
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;
}
Re: eh command error -
jiwan - 19.10.2011
thx Pharrel added to ur repo.