strtok problem
#1

What's wrong with this strtok command?

Код:
 	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;
	}
i get these errors and warnings

Код:
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.
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
Reply


Messages In This Thread
strtok problem - by Pawno_Master - 18.07.2009, 19:36
Re: strtok problem - by yom - 18.07.2009, 19:42
Re: strtok problem - by Pawno_Master - 18.07.2009, 19:50
Re: strtok problem - by yom - 18.07.2009, 19:51
Re: strtok problem - by Pawno_Master - 18.07.2009, 19:58
Re: strtok problem - by yom - 18.07.2009, 20:11
Re: strtok problem - by GTA967 - 18.07.2009, 22:28
Re: strtok problem - by coole210 - 18.07.2009, 22:31
Re: strtok problem - by ledzep - 18.07.2009, 22:55

Forum Jump:


Users browsing this thread: 1 Guest(s)