SA-MP Forums Archive
Help .. "IsNumeric" - 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: Help .. "IsNumeric" (/showthread.php?tid=265572)



Help .. "IsNumeric" - Genious - 01.07.2011

C:\Users\Dani\Desktop\A-RP\gamemodes\A-RP.pwn(1300) : error 017: undefined symbol "IsNumeric"
Код:
		{
		    if(response != 0)
			{
			    if(!IsNumeric(inputtext))
			        return	ShowPlayerDialog(playerid, 5, 1, "Create a Pickup", "Enter a model number to use for this pickup. (wiki.sa-mp.com)", "Enter", "Cancel");
				dini_IntSet(PlayerInfo[playerid][PickupRef], "Model", strval(inputtext));
				dini_IntSet(PlayerInfo[playerid][PickupRef], "Used", 1);
				ShowPlayerDialog(playerid, 6, 0, "Create a Pickup", "Your current location will be used to create this pickup.\r\nYou can edit it later.", "Enter", "Cancel");
			}
			else
				ShowPlayerDialog(playerid, 5, 1, "Create a Pickup", "Enter a model number to use for this pickup. (wiki.sa-mp.com)", "Enter", "Cancel");
		}

Please tell me what's wrong.. ??


Re: Help .. "IsNumeric" - Vince - 01.07.2011

IsNumeric is undefined, that's what it says. Pretty self explanatory.

pawn Код:
stock IsNumeric(const str[])
{
    for(new i, len = strlen(str); i < len; i++)
    {
        if(!('0' <= str[i] <= '9')) return false;
    }
    return true;
}