money question
#1

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?
Reply
#2

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)