[HELP]
#1

in givecash command i have put like this

if(IsNumeric(tmp)){
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /givecash (id) (amount) Amouint Must Be Number");
return 1;
}

all is work every thing but when i try to take money from player when i do like this

/givecash 1 -1000

its tell like that

USAGE: /givecash (id) (amount) Amouint Must Be Number


now how i can make this Code IsNumeric accept that thing -

Код:
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++) {
    if (string[i] > '9' || string[i] < '0') {
return 0;
}
}

return 1;
}
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)