SA-MP Forums Archive
Need to know how to make it not enough money they can't buy - 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 to know how to make it not enough money they can't buy (/showthread.php?tid=89674)



Need to know how to make it not enough money they can't buy - XtremeChio - 03.08.2009

Hello,

I have created simple commands for my server where people can buy their score.
The maximum they can buy at once is 10, so there are 10 commands like this.

Quote:

if(strcmp(cmdtext, "/buyscore 1", true) == 0)
{
GivePlayerMoney(playerid, -1000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
SendClientMessage(playerid,COLOR_ORANGE,"You just bought 1 score for 1000$");
return 1;
}

I did it like that cause I don't know how to make commands where you can choose a number from 1-10.
So I've just tested and you can buy them and you're money simply goes to minus.
How would I make it so if you don't have enough money, you get a message that you don't have enough money.

Btw, 1 score = 2000, 2 score = 4000, 3 score = 6000
Each has 2000$ more so /buyscore 10 would cost 20.000$

Thanks!


Re: Need to know how to make it not enough money they can't buy - XtremeChio - 03.08.2009

Fixed, thanks to Seif again