IsNumeric
#6

I'm going to post this anyway because I spent some time making and testing it which I'm no good at.



PHP код:
    new bool:foundFloat false;
    new 
str[128], index[128];
    
    if(!
IsNumeric(params))
        return 
SendClientMessage(playerid, -1"Your input does not have any numbers."); 
        
    for(new 
00strlen(params); i++)
    {
        
index[j] = i
        
j++;
    }
    
    for(new 
0sizeof(index); i++)
    {
        if(
params[index[i] + 1] == '.')
        {
            
foundFloat true;
        }
    }
    
    if(
foundFloat)
    {
        
SendClientMessage(playerid, -1"A possible float was found, the results:");
        
        
format(strsizeof(str), "%s"params);
        
SendClientMessage(playerid, -1str);
    }
    else
    {
        
SendClientMessage(playerid, -1"A possible float was not found, the results:");
        
        
format(strsizeof(str), "%s"params);
        
SendClientMessage(playerid, -1str);
    } 
Reply


Messages In This Thread
IsNumeric - by IchNar - 18.08.2017, 05:54
Re: IsNumeric - by Kane - 18.08.2017, 05:59
Re: IsNumeric - by Tibbzz - 18.08.2017, 06:01
Re: IsNumeric - by IchNar - 18.08.2017, 06:07
Re: IsNumeric - by Toroi - 18.08.2017, 06:34
Re: IsNumeric - by Kane - 18.08.2017, 06:44
Re: IsNumeric - by IchNar - 18.08.2017, 07:10
Re: IsNumeric - by Vince - 18.08.2017, 07:13
Re: IsNumeric - by DimaShift - 19.08.2017, 12:49

Forum Jump:


Users browsing this thread: 1 Guest(s)