money question - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: money question (
/showthread.php?tid=87902)
money question -
matdav - 22.07.2009
i made a menu where u buy stuff, and idk how to make it so a players money doesnt og into the negatives, so they can only buy it if they have the money
i tried if (GetPlayerMoney[playerid] <= 499 return SendClientMessage(playerid,red,"You need $500!");
GivePlayerWeapon(playerid,358,25);
SetPlayerCash(playerid,-500);
TogglePlayerControllable(playerid,1);
ShowMenuForPlayer(powerw,playerid);
but theres something wrong with it, can somebody please help me?
Re: money question -
refshal - 22.07.2009
pawn Код:
if(GetPlayerMoney(playerid) <= 499)
{
SendClientMessage(playerid,red,"You need $500!");
return 1;
}
GivePlayerWeapon(playerid, 358, 25);
SetPlayerCash(playerid, GetPlayerMoney(playerid) -500);
TogglePlayerControllable(playerid, true);
ShowMenuForPlayer(playerid, powerw);