strtok
#1

I have an error with strtok:

Код:
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28) : error 010: invalid function or declaration
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(922) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(937) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27086) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27146) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27199) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27249) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27366) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27595) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27631) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27713) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27713) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27713) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27822) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(27831) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28256) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28315) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(28996) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29024) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29035) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29095) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29383) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29410) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29440) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29448) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29482) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29490) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Callum Getty\Desktop\Roleplayu\gamemodes\audi.pwn(29523) : error 047: array sizes do not match, or destination array is too small

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
The strtok function:

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;
}
The pawn code line for each one is:
pawn Код:
cmd = strtok(cmdtext, idx);
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=120356
Reply
#3

I can't update like, 5000 commands using that.
Reply
#4

You are having strtok function 2 times in the script OR you are using a FS that have strtok function
Reply
#5

I've checked all of the includes and filterscripts.
Reply
#6

Quote:
Originally Posted by iGetty
Посмотреть сообщение
I can't update like, 5000 commands using that.
You can, and if you have 5,000 commands, it's gonna lag like a bitch lol.
Reply
#7

It means adding "if(sscanf(params, "ud", id, level))" to all commands.. and different to that too..
Reply
#8

Quote:
Originally Posted by iGetty
Посмотреть сообщение
It means adding "if(sscanf(params, "ud", id, level))" to all commands.. and different to that too..
Just a basic shell lol. It'd improve speed ten-fold. As to your error, I have no idea, I'm not a strtok guy, sorry, I just felt the need to post here because of that.
Reply
#9

That's fine, it's not actually my gamemode, I'm doing it for a friend.

No problem at all, thanks for the attempts guys!

+rep for you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)