Error 025 & Error 021
#1

Код:
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
Reply
#2

you've got strtok defined twice
Reply
#3

so, i search strtok(string
?
Reply
#4

the strtok is defined only once

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

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;
}
Reply
#6

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
Reply
#7

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

Okay, thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)