whats wrong with my money thing? - 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: whats wrong with my money thing? (
/showthread.php?tid=214667)
whats wrong with my money thing? -
Legit_V20 - 21.01.2011
heres an example of what im doing
if (GetPlayerMoney =< 1000)
{
GivePlayerWeapon(playerid,24,200);
GivePlayerMoney(playerid,-1000);
return 1;
}
What is wrong?
Re: whats wrong with my money thing? -
Mike Garber - 21.01.2011
Are you sure you wanna remove 1000 from the player
even if he has less then 1000?
Otherwise do;
pawn Код:
if(GetPlayerMoney(playerid)==1000) // Exactly 1000
or
pawn Код:
if(GetPlayerMoney(playerid)>=1000) // 1000 or more
Fixed code;
pawn Код:
if (GetPlayerMoney(playerid) =< 1000) // Maybe It's <= and not =< not sure I'm tired.
{
GivePlayerWeapon(playerid,24,200);
GivePlayerMoney(playerid,-1000);
return 1;
}
Re: whats wrong with my money thing? -
admantis - 21.01.2011
Quote:
Originally Posted by Mike Garber
Are you sure you wanna remove 1000 from the player
even if he has less then 1000?
Otherwise do;
pawn Код:
if(GetPlayerMoney(playerid)==1000) // Exactly 1000
or
pawn Код:
if(GetPlayerMoney(playerid)>=1000) // 1000 or more
Fixed code;
pawn Код:
if (GetPlayerMoney(playerid) =< 1000) // Maybe It's <= and not =< not sure I'm tired. { GivePlayerWeapon(playerid,24,200); GivePlayerMoney(playerid,-1000); return 1; }
|
No difference at all.
pawn Код:
if (GetPlayerMoney(playerid) >= 1000)
{
GivePlayerWeapon(playerid,24,200);
GivePlayerMoney(playerid,-1000);
return 1;
}