SA-MP Forums Archive
When shall i give money? - 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: When shall i give money? (/showthread.php?tid=151836)



When shall i give money? - Ihsan_Cingisiz - 01.06.2010

In which public shall i give money to the player?
If i do by OnPlayerConnect, he gets on every
connection 5k, if i do OnPlayerSpawn, he gets
5k, every spawn :S, what shall i do?


Re: When shall i give money? - Backwardsman97 - 01.06.2010

If you gave him 5k when he connects, then it shouldn't be a problem because it would reset when he left. Unless you have a system to save money, then I would suggest giving it to him when he registers.


Re: When shall i give money? - Ihsan_Cingisiz - 01.06.2010

Quote:
Originally Posted by Baked-Banana
If you gave him 5k when he connects, then it shouldn't be a problem because it would reset when he left. Unless you have a system to save money, then I would suggest giving it to him when he registers.
Hey, yes, i have a register system, thanks
didn't think about it, THANKS!


Re: When shall i give money? - (SF)Noobanatior - 01.06.2010

OnPlayerConnect(playerid) {
if(GetPlayerMoney(playerid) < 5000) {
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,5000);
}

how about this


Re: When shall i give money? - RyDeR` - 01.06.2010

Just use a variable which gets saved when players leaves server. And check when it's 0 to give him, otherwise not.