Error 033 And Error 017
#1

C:\Documents and Settings\Administrator\My Documents\Custom TDM\gamemodes\WCSBS.pwn(671) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Administrator\My Documents\Custom TDM\gamemodes\WCSBS.pwn(671) : error 033: array must be indexed (variable "cmd")

Whats on this line

new cmd [128];
new idx;
cmd = strtok(cmdtext, idx);
Reply
#2

add that on buttom of the script
pawn Код:
stock 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

zcmd + sccanf = faster, easier, all around better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)