Errors [REP+]
#1

Hello

I have the following errors

pawn Код:
(13239) : error 021: symbol already defined: "strtok"
(13254) : error 047: array sizes do not match, or destination array is too small
(13707) : error 021: symbol already defined: "HexToInt"
Error lines

pawn Код:
stock HexToInt(string[])
{
    if (string[0] == 0)
    {
        return 0;
    }
    new i;
    new cur = 1;
    new res = 0;
    for (i = strlen(string); i > 0; i--)
    {
        if (string[i-1] < 58)
        {
            res = res + cur * (string[i - 1] - 48);
        }
        else
        {
            res = res + cur * (string[i-1] - 65 + 10);
            cur = cur * 16;
        }
    }
    return res;
}

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;
}
When I tried to remove that stocks, the compile worked but when I joined in race (Because it is a part from Ryder's race system) I spawned in the air without a car but in correct position/place

+REP to everyone who will help me
Reply


Messages In This Thread
Errors [REP+] - by SecretBoss - 12.02.2015, 12:31
Re: Errors [REP+] - by DRIFT_HUNTER - 12.02.2015, 13:16
Re: Errors [REP+] - by SecretBoss - 12.02.2015, 13:32
Re: Errors [REP+] - by PowerPC603 - 12.02.2015, 13:51
Re: Errors [REP+] - by SecretBoss - 12.02.2015, 13:58
Re: Errors [REP+] - by asto63 - 12.02.2015, 14:02

Forum Jump:


Users browsing this thread: 2 Guest(s)