SA-MP Forums Archive
inputtext for only number - 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)
+--- Thread: inputtext for only number (/showthread.php?tid=618939)



inputtext for only number - Pearson - 11.10.2016

Can someone give me simple code for inputtext with only numbers?


Re: inputtext for only number - Konstantinos - 11.10.2016

https://sampforum.blast.hk/showthread.php?tid=602923

pawn Код:
new number;
if (!sscanf(inputtext, "i", number))
{
    // number was inputted
}
else
{
    // not a number, return an error
}