SA-MP Forums Archive
Error 025 & Error 021 - 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: Error 025 & Error 021 (/showthread.php?tid=175569)



Error 025 & Error 021 - Mr.Obscure - 10.09.2010

Код:
C:\Users\Public\HC-RP\gamemodes\SWRP.pwn(17788) : error 025: function heading differs from prototype
C:\Users\Public\HC-RP\gamemodes\SWRP.pwn(17789) : error 021: symbol already defined: "strtok"
C:\Users\Public\HC-RP\gamemodes\SWRP.pwn(17817) : error 047: array sizes do not match, or destination array is too small
pawn Код:
17788 >> strtok(string[],&idx,seperator = ' ')
17789 >> {
I'm confused


Re: Error 025 & Error 021 - cessil - 10.09.2010

you've got strtok defined twice


Re: Error 025 & Error 021 - Mr.Obscure - 10.09.2010

so, i search strtok(string
?


Re: Error 025 & Error 021 - Mr.Obscure - 10.09.2010

the strtok is defined only once

#include <a_samp>
//#include <dns>
#include <dini>
#include <a_npc>


Re: Error 025 & Error 021 - Brian_Furious - 10.09.2010

try this:
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;
}



Re: Error 025 & Error 021 - Mr.Obscure - 10.09.2010

C:\Users\Public\HC-RP\gamemodes\SWRP.pwn(17802) : error 021: symbol already defined: "strtok"
C:\Users\Public\HC-RP\gamemodes\SWRP.pwn(17817) : error 047: array sizes do not match, or destination array is too small

that's my code
pawn Код:
strtok(string[],&idx,seperator = ' ')
{
    new ret[128], i = 0, len = strlen(string);
    while(string[idx] == seperator && idx < len) idx++;
    while(string[idx] != seperator && idx < len)
    {
        ret[i] = string[idx];
        i++;
        idx++;
    }
    while(string[idx] == seperator && idx < len) idx++;
    return ret;
}
whit you're code the error 025 are fixed


Re: Error 025 & Error 021 - [HiC]TheKiller - 10.09.2010

Just delete the whole thing because DINI has it in it's include.


Re: Error 025 & Error 021 - Mr.Obscure - 10.09.2010

Okay, thx