2 Errors how to fix?
#1

Quote:

C:\Documents and Settings\Dean\Desktop\Samp server\gamemodes\pp.pwn(40) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\Dean\Desktop\Samp server\gamemodes\pp.pwn(55) : error 047: array sizes do not match, or destination array is too small

Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
new IsLogged[MAX_PLAYERS];

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;
What's the problem?
Reply
#2

As I said earlier, you need to remove strtok function as it is already defined in dini, which is what you are using.
Reply
#3

If i remove that, then pawno crashes. i dont know why
Reply
#4

Give me your includes that are at the top.
"#include"
Reply
#5

#include <a_samp>
#include <dini>
#include <dudb>
Reply
#6

You didn't remove the strtok properly, see if you forgot a bracket, because you missed one when you posted the function here.
Reply
#7

well, if your running dini, you need to remove it, or remove the strtok, as Adil say, its true, mabye you frogot somthing. check it
Reply
#8

Ok, i have now fixed it. as adil said i forgot some brackets.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)