23.05.2014, 17:57
(
Последний раз редактировалось MultiKill; 23.05.2014 в 20:11.
)
Manda a linha do erro.
Ficaria +- assim:
Esqueci de falar. Coloque isto caso de undefined strtok:
Ficaria +- assim:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256],idx;
cmd = strtok(cmdtext,idx);
if(strcmp(cmdtext,"/teste",true) == 0)
{
SendClientMessage(playerid,-1,"Vocк usou o comando /teste");
return 1;
}
return 0;
}
pawn Код:
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;
}