Take Money away? - 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: Take Money away? (
/showthread.php?tid=139682)
Take Money away? -
campkz - 05.04.2010
GivePlayerMoney(playerid, -10000);
would that make the player have 10000 less, if not how do i do this?
Re: Take Money away? -
~JDS - 05.04.2010
i don't know if that would work.... just try
if it doesn't this schould do it:
Код:
new oldmoney, newmoney;
oldmoney = GetPlayerMoney(playerid);
newmoney = oldmoney - 10000;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, newmoney);
Re: Take Money away? -
Beaver07 - 05.04.2010
Quote:
Originally Posted by campkz
GivePlayerMoney(playerid, -10000);
would that make the player have 10000 less, if not how do i do this?
|
yeah that's right
Re: Take Money away? -
aircombat - 05.04.2010
Код:
new money = GetPlayerMoney(playerid);
GivePlayerMoney(playerid,money-1000);
Re: Take Money away? -
Carlton - 05.04.2010
Quote:
Originally Posted by [AC
Etch ]
Код:
new money = GetPlayerMoney(playerid);
GivePlayerMoney(playerid,money-1000);
|
That's the long and useless way. GivePlayerMoney allows you to take money, or give money to a user. So there's no point of using GetPlayerMoney then giving them $1000 less. The function is called GivePlayerMoney, not SetPlayerMoney.
Re: Take Money away? -
Joe Staff - 05.04.2010
Quote:
Originally Posted by [AC
Etch ]
Код:
new money = GetPlayerMoney(playerid);
GivePlayerMoney(playerid,money-1000);
|
That would give the player however much money he has AND THEN subtract 1000, so it's doubling their cash and subtracting 1000.
GivePlayerMoney gives money, not sets it.
Re: Take Money away? -
Beaver07 - 05.04.2010
Quote:
Originally Posted by Beaver07
Quote:
Originally Posted by campkz
GivePlayerMoney(playerid, -10000);
would that make the player have 10000 less, if not how do i do this?
|
yeah that's right
|
wats wrong with what he put in the first place?
Re: Take Money away? -
Joe_ - 05.04.2010
Strange
pawn Код:
GivePlayerMoney(playerid, -1000);
Works for me lol.