SA-MP Forums Archive
Calculations in Pawn - 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: Calculations in Pawn (/showthread.php?tid=85618)



Calculations in Pawn - watkijkje - 08.07.2009

Hello everyone,

pawn Код:
#define MAX_AUDIO_FILES 4

new Float:size = P[playerid][downloadedfiles] / MAX_AUDIO_FILES;
printf("%i,%f",P[playerid][downloadedfiles],size);
This function doesn't want to return numbers with comma's:

When P[playerid][downloadedfiles] = 1 then this functions returns 0 instead of 0.25,
When P[playerid][downloadedfiles] = 2 then this functions returns 0 instead of 0.50,
When P[playerid][downloadedfiles] = 3 then this functions returns 0 instead of 0.75,
when P[playerid][downloadedfiles] = 4 then it returns 1

Does anybody know how to fix this?

Thanks