SA-MP Forums Archive
Problem with errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with errors (/showthread.php?tid=248477)



Problem with errors - IvancheBG - 14.04.2011

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;



Re: Problem with errors - Lorenc_ - 14.04.2011

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


Re: Problem with errors - IvancheBG - 14.04.2011

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


Re: Problem with errors - Cameltoe - 14.04.2011

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.


Re: Problem with errors - IvancheBG - 14.04.2011

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"


Re: Problem with errors - Cameltoe - 14.04.2011

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);



Re: Problem with errors - IvancheBG - 14.04.2011

i fixed it