Money rent.
#1

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

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);
Reply
#3

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);
Reply
#4

probably because money isn't a float
Код:
new cash = floatround(Money/100*1,floatround_round);
GivePlayerMoney(i,cash);
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)