23.07.2012, 04:18
I looked on https://sampwiki.blast.hk/wiki/Strtok and followed it step by step. Below is what I came up with and under that are the errors I have.
I am currently unclear at this point and have no idea where to start fixing it. I would like a nudge in the right direction on where to fix this.
NOTE: This is my first command like this so I am pretty much completely lost.
Thanks for the assistance!
Happy Scripting!
EDIT: Bold are lines with errors
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[128], idx; //Line 93 cmd = strtok(cmdtext, idx); //Line 94 if(strcmp(cmd, "/kick", true) == 0) { new tmp[128]; tmp = strtok(cmdtext, idx); //Line 99 if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid]"); Kick(strval(tmp)); return 1; } return 0; }
Код:
C:\Users\*****\Desktop\GTA Servers\Samp 0.3e server\gamemodes\Test.pwn(94) : error 017: undefined symbol "strtok" C:\Users\*****\Desktop\GTA Servers\Samp 0.3e server\gamemodes\Test.pwn(94) : error 033: array must be indexed (variable "cmd") C:\Users\*****\Desktop\GTA Servers\Samp 0.3e server\gamemodes\Test.pwn(99) : error 017: undefined symbol "strtok" C:\Users\*****\Desktop\GTA Servers\Samp 0.3e server\gamemodes\Test.pwn(99) : error 033: array must be indexed (variable "tmp") C:\Users\*****\Desktop\GTA Servers\Samp 0.3e server\gamemodes\Test.pwn(93) : warning 203: symbol is never used: "idx"
NOTE: This is my first command like this so I am pretty much completely lost.
Thanks for the assistance!
Happy Scripting!
EDIT: Bold are lines with errors