SA-MP Forums Archive
random - 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: random (/showthread.php?tid=205202)



random - armyoftwo - 31.12.2010

pawn Код:
new RobbedMoney = random(GetPlayerCash(playerid));
    printf("ROBBED: %i", RobbedMoney);
for example he haves 20000 but it prints 4120000 wtf?


Re: random - Krx17 - 31.12.2010

Show us your GetPlayerCash function.


Re: random - armyoftwo - 31.12.2010

It returns money how much you have as i said he haves 20000
Fixed


Re: random - Joe Staff - 31.12.2010

If you're using a 'decimal system' (i.e. $14.00) then GetPlayerCash returns a float.

You'll have to use
pawn Код:
new rand=random(floatround(GetPlayerCash(playerid)));