Correct cmds plz ^^
#4

Add This at the end of your script:


pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}


pawn Код:
stock IsNumeric(const string[]) {
    new length=strlen(string);
    if (length==0) return false;
    for (new i = 0; i < length; i++) {
        if (
        (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')
        || (string[i]=='-' && i!=0)                                             //
        || (string[i]=='+' && i!=0)                                             //
        ) return false;
    }
    if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
    return true;
}
Reply


Messages In This Thread
Correct cmds plz ^^ - by Michael@Belgium - 09.01.2011, 12:52
Re: Correct cmds plz ^^ - by Mr.Stranger - 09.01.2011, 13:21
Re: Correct cmds plz ^^ - by Michael@Belgium - 09.01.2011, 14:10
Re: Correct cmds plz ^^ - by Mr.Stranger - 09.01.2011, 14:13

Forum Jump:


Users browsing this thread: 1 Guest(s)