Random Money doesn't work - 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)
+--- Thread: Random Money doesn't work (
/showthread.php?tid=520501)
Random Money doesn't work -
KurtAngle - 19.06.2014
I have a problem with random money.
When a player finish a particular job, he should earn random money, but he doesn't earn nothing.
I will explain: when this player enter on finish checkpoint, he appear a message for example that says: "You have earned $320." But the dollars text at the top stay stationary, because in truth he earn 0$. The only thing that work is SendClientMessage, but GivePlayerMoney doesn't work and I don't understand why.
Here is the code:
Код:
new randommoney = random((300-500)+500);
switch (randommoney)
{
case 0:
{
GivePlayerMoney(playerid, randommoney);
}
}
new string[256];
format(string, sizeof(string), "You have finished the job and you have earned $%d!", randommoney);
SendClientMessage(playerid, GIALLO, string);
Re: Random Money doesn't work -
KurtAngle - 19.06.2014
I fixed myself, if you can help, that is what i have did:
Код:
new randommoney = random(700);
GivePlayerMoney(playerid,randommoney);
new string[256];
format(string, sizeof(string), "You have finished the job and you have earned $%d!", randommoney);
SendClientMessage(playerid, GIALLO, string);