SA-MP Forums Archive
Sscanf setting . decimal numbers? - 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: Sscanf setting . decimal numbers? (/showthread.php?tid=269079)



Sscanf setting . decimal numbers? - cloudysky - 14.07.2011

Basically for my set gravity command I need to be able to set the gravity to 0.008. How would I do this on Sscanf would it be 4 "d"s?


Re: Sscanf setting . decimal numbers? - Zh3r0 - 14.07.2011

When a number is like 0.0008, its called float. So it goes like
pawn Код:
if(sscanf(params, "f", params[0])) return SendClientMessage(playerid, -1, "Error! The parameter must be a float. (IE: /setgravity 0.0008");

EDIT: ******, why use G instead of f,F ?


Re: Sscanf setting . decimal numbers? - cloudysky - 14.07.2011

Thanks


Re: Sscanf setting . decimal numbers? - cloudysky - 14.07.2011

It seemed to completely bug up the server, I typed in 0.008 and it came up a number like 354643.