SA-MP Forums Archive
Check if is numeric - 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: Check if is numeric (/showthread.php?tid=68927)



Check if is numeric - TheAngel105 - 14.03.2009

Is there any way to check if "params" from dcmd is a number?


Re: Check if is numeric - On_Top_Non_Stop - 14.03.2009

I recommend using Sscanf if you arent already.

https://sampwiki.blast.hk/wiki/Sscanf



Re: Check if is numeric - TheAngel105 - 14.03.2009

Yes I am using it but how do I check if it's a number?


Re: Check if is numeric - On_Top_Non_Stop - 14.03.2009

if(sscanf(params, "d", YourVariable)) SendClientMessage(playerid,color,"Must be a number.");


Re: Check if is numeric - TheAngel105 - 15.03.2009

Thanks a lot, that works