[SOLVED]need some help: array must be indexed
#1

pawn Код:
new tmp[256], tmp2[256], Index;
  tmp = strtok(params,Index);
  tmp2 = strtok(params,Index);
  if(!strlen(params)) return SendClientMessage(....);
  if(!strlen(tmp2)) return SendClientMessage(....);
        new playertoban, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128], string2[128], string3[128];
        playertoban = strval(tmp);
Код:
D:\Juan\Programas\GTA\Creaciones Propias\CAdmin v 1.0\FilterScript\CAdmin 1.0.pwn(604) : error 017: undefined symbol "strtok"
D:\Juan\Programas\GTA\Creaciones Propias\CAdmin v 1.0\FilterScript\CAdmin 1.0.pwn(604) : error 033: array must be indexed (variable "tmp")
D:\Juan\Programas\GTA\Creaciones Propias\CAdmin v 1.0\FilterScript\CAdmin 1.0.pwn(605) : error 017: undefined symbol "strtok"
D:\Juan\Programas\GTA\Creaciones Propias\CAdmin v 1.0\FilterScript\CAdmin 1.0.pwn(605) : error 033: array must be indexed (variable "tmp2")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
don't know how to fix this :S
Reply
#2

You need a strtok function in your script.
Reply
#3

Add this:
Код:
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;
}
at the bottom of your script.
Reply
#4

thanks both of u it work now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)