SA-MP Forums Archive
Losing $100 on death - 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: Losing $100 on death (/showthread.php?tid=450128)



Losing $100 on death - siemka321 - 11.07.2013

Alright, so there's this little problem. The player loses $100 on death by default, and I don't want that to happen. Mostly the solution is to give the player 100 when he dies, but then another problem shows up. You see, if the player has less than $100 and he dies, he will only go to 0, he will not go to minus. This means that if I die having $50, I will go to $0 and then go to $100. This means that I can receive more money by dying. Anyone know how to solve this problem?


Re: Losing $100 on death - Konstantinos - 11.07.2013

Losing money by default? No, you lose money only if in OnPlayerDeath callback, you take -100. Search to your gamemode and filterscripts.


Re: Losing $100 on death - Dragonsaurus - 11.07.2013

Just use GetPlayerMoney(playerid) maybe on OnPlayerUpdate, and store it in a variable, to use it on OnPlayerDeath.
First check if the variable contains a value less than $100, and use GivePlayerMoney(playerid, variablename);
I think you will solve it this way.


Re: Losing $100 on death - Konstantinos - 11.07.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Actually, you do loose money by default.
I used server-side money and that's why I did not loose in any of my scripts.