Need help with Money script. - 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: Need help with Money script. (
/showthread.php?tid=258598)
Need help with Money script. -
MadalinX5 - 31.05.2011
Ok so i made a script that it costs you 1000$ to buy an mp5. I want to make an "if" that checks if you have 0$ will say you don't have money and if you have < 1000 you don't have enough. Please help

.
Код:
if (strcmp("/mp5", cmdtext, true, 10) == 0)
{
GivePlayerMoney(playerid, -1000);
GivePlayerWeapon(playerid, 29, 500);
SendClientMessage(playerid, COLOR_YELLOW, "You have received a MP5.");
return 1;
}
Re: Need help with Money script. -
Cenation - 31.05.2011
posting in few mins wait...
Re: Need help with Money script. -
Cenation - 31.05.2011
Код:
if (strcmp("/mp5", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,0xFF0000AA, "You don't have enough money!You Need 1,000!");
SendClientMessage(playerid, COLOR_YELLOW, "You have received a MP5.");
GivePlayerWeapon(playerid, 29, 500);
GivePlayerMoney(playerid, -1000);
return 1;
}
ok?
Re: Need help with Money script. -
wheelman_WM - 31.05.2011
Код:
if(GetPlayerMoney(playerid) >=Money)
It will help you
Re: Need help with Money script. -
MadalinX5 - 31.05.2011
Thank you! It's perfect
Re: Need help with Money script. -
Cenation - 31.05.2011
its ok like that too...

np