Check if numeric
#1

mainly I got this code:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]){
    new idx, cmd[256], rest[256];
    cmd = strtok(cmdtext, idx);
    strpack(rest, cmdtext);
    strdel(rest, 0, idx + 1);

    if(strfind(cmd, "/race", true) == 0){
        if(strfind(rest, "help", true) == 0) return RaceHelp(playerid);
        if(strfind(rest, "create", true) == 0) return RaceCreate(playerid);
        if(strfind(rest, "checkpoint", true) == 0) return RaceCheckpoint(playerid);
        if(strfind(rest, "end", true) == 0) return RaceEnd(playerid);
        if(strfind(rest, "invite", true) == 0) return RaceInvite(playerid, rest);
        if(strfind(rest, "accept", true) == 0) return RaceAccept(playerid);
        RaceHelp(playerid);
        return 1;
    }
    return 0;
}
Now, if a player inserts /race invite [playerid] a player will be invited trough a stock. But within this stock i tried to create a script to check if the text submitted in [playerid] was numeric, some way it allways is no matter what you give in. I really tried everything:

- strval; but when text is inserted it will be 0, making the script inviting player number 0.
- isnumeric (with #include <YSI/y_utils>); but seems to be allways numeric
- etcetera

Please help :S
Reply


Messages In This Thread
Check if numeric - by Anteino - 16.02.2011, 19:07
Re: Check if numeric - by randomkid88 - 16.02.2011, 19:46
Re: Check if numeric - by Hal - 16.02.2011, 19:49
AW: Check if numeric - by thiaZ_ - 16.02.2011, 19:50
Re: AW: Check if numeric - by Hal - 16.02.2011, 19:53
Re: Check if numeric - by Anteino - 16.02.2011, 19:54
Re: Check if numeric - by Calgon - 16.02.2011, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)