27.07.2012, 09:50
How can I fix these errors
THis is the script.
Код:
C:\Users\Osman Ali\Desktop\Skin.pwn(92) : error 017: undefined symbol "strtok" C:\Users\Osman Ali\Desktop\Skin.pwn(92) : error 033: array must be indexed (variable "cmd") C:\Users\Osman Ali\Desktop\Skin.pwn(98) : error 017: undefined symbol "strtok" C:\Users\Osman Ali\Desktop\Skin.pwn(98) : error 033: array must be indexed (variable "tmp") C:\Users\Osman Ali\Desktop\Skin.pwn(91) : warning 203: symbol is never used: "idx" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/clothes", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,40.0,207.4733,-109.8061,1005.1328))
{
new tmp[128];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /clothes [skinid]");
if(strval(tmp) >= 0 && strval(tmp) <= 299) SetPlayerSkin(playerid, strval(tmp)); //Checks if valid skinid. Also, make sure you restrict skins that aren't used, because if there is a skinid with no skin, player crashes.
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in range of whatever");
return 1;
}
return 0;
}