SA-MP Forums Archive
Set Player Money to 0 - 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: Set Player Money to 0 (/showthread.php?tid=422109)



Set Player Money to 0 - Mrich - 12.03.2013

sorry for this stupid question a player has 154$ i want to set his money to 0 how to do it?

tryed this : new Money=GetPlayerMoney(playerid); & GivePlayerMoney a lot of times but don't work .


Re: Set Player Money to 0 - IgrexolonO - 12.03.2013

https://sampwiki.blast.hk/wiki/ResetPlayerMoney


Re: Set Player Money to 0 - Itzhak E. - 12.03.2013

Use your best friend, ******.
Here you go: https://sampwiki.blast.hk/wiki/ResetPlayerMoney


Re: Set Player Money to 0 - YesYesYes - 12.03.2013

pawn Код:
ResetPlayerMoney(playerid);
alternatively
pawn Код:
new money = GetPlayerMoney(playerid);
GivePlayerMoney(playerid, -money) // deduct the amount of money the player currently have
use search next time first or refer to the wiki
ResetPlayerMoney

EDIT:too late


Re: Set Player Money to 0 - Mrich - 12.03.2013

thanks all !


Re: Set Player Money to 0 - MP2 - 12.03.2013

Quote:
Originally Posted by YesYesYes
Посмотреть сообщение
pawn Код:
ResetPlayerMoney(playerid);
alternatively
pawn Код:
new money = GetPlayerMoney(playerid);
GivePlayerMoney(playerid, -money) // deduct the amount of money the player currently have
Why would you even think about doing that? You're using a variable, you're calling GetPlayerMoney, you're processing the subtraction and for what? To give the exact same effect as ResetPlayerMoney()...


Re: Set Player Money to 0 - steki. - 12.03.2013

Quote:
Originally Posted by MP2
Посмотреть сообщение
Why would you even think about doing that? You're using a variable, you're calling GetPlayerMoney, you're processing the subtraction and for what? To give the exact same effect as ResetPlayerMoney()...
"alternatively"


Re: Set Player Money to 0 - MP2 - 13.03.2013

You can also alternatively format a string one character at a time. You can also use a loop to add one to a variable until it reaches 2000 instead of just initialising it to 2000. Doesn't mean it's advisable!