28.05.2010, 21:00
guys u are all answering him wrong do u really think this ::
will work?? it doesn't even use strtok
Topic Poster : i sent u a pm of my email , i can help u creating the command and fixing ur errors buddy
Код:
public OnPlayerCommandText(playerid,cmdtext[]) { new index, cmd[128]; cmd = strtok(cmdtext, index); if (!strcmp("/color",cmd,true,6)) { SetPlayerColor(playerid,Color);//COLOR = COLOR return 1; } return 0; } //----------------------------------------- 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; }
Topic Poster : i sent u a pm of my email , i can help u creating the command and fixing ur errors buddy
