SA-MP Forums Archive
Help with the money :) - 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: Help with the money :) (/showthread.php?tid=175123)



Help with the money :) - Matej_ - 08.09.2010

I need to check if player has 10,000$ money or less,
so I need to put this in my script

pawn Код:
if(GetPlayerMoney(playerid) < 10000)
But that only checks if you got 10,000 and not less money
so is there any functions to check player money from 1$ to 10,000$
like this:

pawn Код:
if(GetPlayerMoney(playerid) < 1 > 10000)
Thanks for the help !


Re: Help with the money :) - R@ger - 08.09.2010

Quote:

if(GetPlayerMoney(playerid) >1 || < 10000)

that should help i guess xD


Re: Help with the money :) - [XST]O_x - 08.09.2010

Quote:
Originally Posted by R@ger
Посмотреть сообщение
that should help i guess xD
Almost.
pawn Код:
if(GetPlayerMoney(playerid) < 10000 && GetPlayerMoney(playerid) > 1)



Re: Help with the money :) - Cameltoe - 08.09.2010

Quote:
Originally Posted by R@ger
Посмотреть сообщение
that should help i guess xD
pawn Код:
if(GetPlayerMoney(playerid) > 1 || GetPlayerMoney(playerid) < 10000)
I don't think roger's work, if it does, then i got a lot of inefficient scripting in my gm.


Re: Help with the money :) - RyDeR` - 08.09.2010

You meant:
Код:
if(10000 < GetPlayerMoney(playerid) < 1) return // Message or something for not enough money or only between 1 and - 10000;



Re: Help with the money :) - R@ger - 08.09.2010

oops sorry xD


Re: Help with the money :) - Joe Staff - 08.09.2010

Quote:
Originally Posted by Matej_
Посмотреть сообщение
pawn Код:
if(GetPlayerMoney(playerid) < 10000)
That will check if the player has less than $10,000, but that also includes negative numbers, like -20000.

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
pawn Код:
if(GetPlayerMoney(playerid) < 10000 && GetPlayerMoney(playerid) > 1)
That will check if the player has less than $10,000, but MORE than $1, so if the player has only $1, it won't work.

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
if(GetPlayerMoney(playerid) > 1 || GetPlayerMoney(playerid) < 10000)
That will check if the player has ANY number above 1, OR any number below 10,000... which means ANY number...

pawn Код:
if( (GetPlayerMoney(playerid)>=0) && (GetPlayerMoney(playerid)<=10000) )
This will check if the player has any amount between and including $0 and $10,000.


Re: Help with the money :) - [XST]O_x - 08.09.2010

@RyDeR` - How the?

Checking if a player has more than $10,000 yet less than $1?

Maybe
pawn Код:
if(10000 < GetPlayerMoney(playerid) >= 1)



Re: Help with the money :) - Matej_ - 08.09.2010

So which one of these is the correct


Re: Help with the money :) - Nero_3D - 08.09.2010

Quote:
Originally Posted by Matej_
Посмотреть сообщение
So which one of these is the correct
That

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
pawn Код:
if( (GetPlayerMoney(playerid)>=0) && (GetPlayerMoney(playerid)<=10000) )
and that

pawn Код:
if(0 <= GetPlayerMoney(playerid) <= 10_000) {}
[XST]O_x you still got a mistake