What's wrong ?
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])

{
	new cmd[256];
	new target, idx;
	cmd = strtok(cmdtext, idx);
	if(strcmp(cmd, "/hide", true) == 0)
	{
		if(team[playerid] != 2) return SendClientMessage(playerid, YELLOW, "You are not a Zombie!");
		TogglePlayerControllable(playerid, 0);
 		ApplyAnimation(playerid,"DAM_JUMP","SF_JUMPWALL",999999,0,1,1,1,1);
        UsingAnimation[playerid] = 1;
		return 1;
	}
Код:
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\zombieoutbreak.pwn(863) : error 017: undefined symbol "strtok"
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\zombieoutbreak.pwn(863) : error 033: array must be indexed (variable "cmd")
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\zombieoutbreak.pwn(862) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Just add strtok to your script:
pawn Код:
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;
}
Reply
#3

oh yeah, it worked, I think I deleted bu accident cleaning my script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)