Money rent. - 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: Money rent. (
/showthread.php?tid=150639)
Money rent. -
bartje01 - 27.05.2010
Hey guys. I'm trying to make that you will get rent 1% rent but I just can't come out of what code I have to use.
I was thinking of somethnig like this:
GivePlayerMoney(i,%1.0$);
But that is giving me this errors :P
Код:
C:\Users\Bart\Desktop\Fresh RPG server\filterscripts\ladmin4v2.pwn(6728) : error 029: invalid expression, assumed zero
C:\Users\Bart\Desktop\Fresh RPG server\filterscripts\ladmin4v2.pwn(6728) : warning 215: expression has no effect
C:\Users\Bart\Desktop\Fresh RPG server\filterscripts\ladmin4v2.pwn(6728) : error 001: expected token: ";", but found "$"
C:\Users\Bart\Desktop\Fresh RPG server\filterscripts\ladmin4v2.pwn(6728) : error 029: invalid expression, assumed zero
C:\Users\Bart\Desktop\Fresh RPG server\filterscripts\ladmin4v2.pwn(6728) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Please help someone
Re: Money rent. -
Babul - 27.05.2010
100 percent equals 1.00, if you want to add 1 percent, just add 1/100 = 0.01:
Код:
new Money=GetPlayerMoney(i);
GivePlayerMoney(i,Money*0.01);
Re: Money rent. -
bartje01 - 27.05.2010
alright thanks for heping but 1 warning.
C:\Users\Bart\Desktop\Fresh RPG server\filterscripts\ladmin4v2.pwn(6729) : warning 213: tag mismatch
GivePlayerMoney(i,Money*0.01);
Re: Money rent. -
cessil - 27.05.2010
probably because money isn't a float
Код:
new cash = floatround(Money/100*1,floatround_round);
GivePlayerMoney(i,cash);
Re: Money rent. -
Babul - 27.05.2010
thx cessil for correcting, i forgot to put the "Int:" (integer), anyways, my solution would only work if the player has more than $100 -> use his solution
Re: Money rent. -
[HiC]TheKiller - 27.05.2010
Quote:
Originally Posted by Babul
thx cessil for correcting, i forgot to put the "Int:" (integer), anyways, my solution would only work if the player has more than $100 -> use his solution 
|
Yours would work if you used floatround in it

.