C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(386) : error 017: undefined symbol "cmd" C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(389) : error 017: undefined symbol "strtok" C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(389) : error 033: array must be indexed (variable "tmp")
if(strcmp(cmd, "/myskin", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAA3333AA, "Usage: /myskin [skinid]");
return 1;
}
new skin;
skin = strval(tmp);
new string[128];
format(string, sizeof(string), "You change your skin to this skin ID: %d", skin);
SendClientMessage(playerid, 0xFFFF00AA, string);
SetPlayerSkin(playerid, skin);
return 1;
|
sorry but i dont found STRTOK in the forum can you tell me how
|
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;
}
|
i did this now i have theese
C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(404) : error 017: undefined symbol "cmd" C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(407) : error 017: undefined symbol "idx" |
new cmd[128], idx;
cmd = strtok(cmdtext, idx);