18.07.2009, 19:36
What's wrong with this strtok command?
i get these errors and warnings
i know that if i use that command
cops can cuff anyone including cops and that they can cuff everybody with no problem with distance so the can cuff someone is the someone isn; t close to the cop
but i dont know how that works
im still learning and searching on that
Код:
new tmp[128], string[128], cmd[128], idx, giveplayerid, sendername, giveplayer; cmd = strtok(cmdtext, idx); GetPlayerName(playerid, sendername, sizeof(sendername)); if(strcmp(cmd, "/cuff", true) == 0) { if(gTeam[playerid] != TEAM_COPS){ return SendClientMessage(playerid, 0x919191FF, "BE ADMIN!");} // when player isn't admin, don't let to use command tmp = strtok(cmdtext, idx); // We assign that we use strtok in this command to 'tmp' if(!strlen(tmp)) return SendClientMessage(playerid, oranje, "USAGE: /cuff [id]"); // If no ID is given giveplayerid = strval(tmp); // Now we assign the 'giveplayerid' if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, donkerrood, "That player doesn't exist"); // when 'giveplayerid' isn't online TogglePlayerControllable(playerid, 0); return 1; }
Код:
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1616) : error 047: array sizes do not match, or destination array is too small C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1617) : error 035: argument type mismatch (argument 2) C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1617) : error 035: argument type mismatch (argument 2) C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1621) : error 047: array sizes do not match, or destination array is too small C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1615) : warning 203: symbol is never used: "giveplayer" C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1615) : warning 203: symbol is never used: "sendername" C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1615) : warning 204: symbol is assigned a value that is never used: "string" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
cops can cuff anyone including cops and that they can cuff everybody with no problem with distance so the can cuff someone is the someone isn; t close to the cop
but i dont know how that works
im still learning and searching on that