SA-MP Forums Archive
[HELP] tracking players - 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: [HELP] tracking players (/showthread.php?tid=264643)



[HELP] Shop system - zouyun - 27.06.2011

I added a /buydeagle command

Код:
    
if (strcmp(cmdtext, "/buyarmour", true) == 0)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_GREEN, "You have full armor now");
GivePlayerMoney(playerid, -1000);
return 1;
}
But then when I use it in game if I had 500$ it will bring me to -500$.
How do I add something that would check if he has the money.


Re: [HELP] tracking players - Tee - 27.06.2011

Just add:

pawn Код:
if(GetPlayerMoney(playerid) < The amount of cash needed to buy the thing)return SendClientMessage(playerid,-1,"You need x amount of money to buy this.");
Before you give them the guns just add that there. Like at SetPlayerArmour(playerid,100); add that check in the line before that.

Example:

pawn Код:
if(GetPlayerMoney(playerid) < 500)return SendClientMessage(playerid,-1,"You need $500 to buy this.");
Oh and -1 would set the color to white.


Re: [HELP] tracking players - zouyun - 27.06.2011

Thanks it works perfectly.