Problem with errors
#1

OK hi i made a myskin command but it sned these errors

Код:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(386) : error 017: undefined symbol "cmd"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(389) : error 017: undefined symbol "strtok"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(389) : error 033: array must be indexed (variable "tmp")
And thisi my skin command

Код:
if(strcmp(cmd, "/myskin", true) == 0)
    {
        new tmp[256];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xAA3333AA, "Usage: /myskin [skinid]");
            return 1;
        }
        new skin;
        skin = strval(tmp);
        new string[128];
        format(string, sizeof(string), "You change your skin to this skin ID: %d", skin);
        SendClientMessage(playerid, 0xFFFF00AA, string);
        SetPlayerSkin(playerid, skin);
        return 1;
Reply
#2

look around the forum for that function STRTOK and the other error where is the line?
Reply
#3

sorry but i dont found STRTOK in the forum can you tell me how
Reply
#4

Quote:
Originally Posted by IvancheBG
Посмотреть сообщение
sorry but i dont found STRTOK in the forum can you tell me how
You did an good job searching then i guess.

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;
}
Now show us the other line.

And also, https://sampforum.blast.hk/showthread.php?tid=248473 You are not allowed to post two different threads regarding the same issue.
Reply
#5

i did this now i have theese

C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(404) : error 017: undefined symbol "cmd"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(407) : error 017: undefined symbol "idx"
Reply
#6

Quote:
Originally Posted by IvancheBG
Посмотреть сообщение
i did this now i have theese

C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(404) : error 017: undefined symbol "cmd"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\test.pwn(407) : error 017: undefined symbol "idx"
https://sampwiki.blast.hk/wiki/Strtok Read read read, this forum is the discuss, not to request.

pawn Код:
new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
Reply
#7

i fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)