C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(742) : error 017: undefined symbol "cmd" C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(747) : error 017: undefined symbol "strtok" C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(747) : error 033: array must be indexed (variable "tmp") C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(756) : error 017: undefined symbol "strtok" C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(756) : error 033: array must be indexed (variable "tmp") |
if(strcmp(cmd, "/cc", true) == 0) { new tmp[256]; new co1; new co2; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_YELLOW, "ERROR: /cc [ID1] [ID2]"); return 1; } co1 = strval(tmp); ChangeVehicleColor(GetPlayerVehicleID(playerid), co1, co1); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { ChangeVehicleColor(GetPlayerVehicleID(playerid), co1, co1); return 1; } co2 = strval(tmp); ChangeVehicleColor(GetPlayerVehicleID(playerid), co1, co2); return 1; } |
I guess this link will help you.
https://sampforum.blast.hk/showthread.php?tid=199796 |
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 put this under the /cc command but then i get 12 errors :/
|