16.02.2011, 19:07
mainly I got this code:
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
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;
}
- 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