Set Player Money to 0
#1

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 .
Reply
#2

https://sampwiki.blast.hk/wiki/ResetPlayerMoney
Reply
#3

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

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
Reply
#5

thanks all !
Reply
#6

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()...
Reply
#7

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"
Reply
#8

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)