pawn Код:
stock GetVarType(variable[])
{
new length = strlen(variable), dots, letters, bool:negative = false;
if(variable[0] == '-') negative = true;
for(new i; i<length; i++)
{
if(negative == false) {
if((variable[i] == '.') && (i>0) && i<(length-1)) dots++;
else if((variable[i] > '9') || (variable[i] < '0')) letters++;
}
else {
if((variable[i] == '.') && (i>1) && i<(length-1)) dots++;
else if(((variable[i] > '9') || (variable[i] < '0')) && (i != 0)) letters++;
}
}
if(dots == 1 && letters == 0) return 1; // float
else if(letters > 0 ) return 2; //string
return 0; // integer
}