[HELP] Need help with rank system
#1

Hello, im from Argentina, im using sananmoneygrub0.5 with some adds of me, its for a DM server, and i want to Add a rank system, especially the Sandra's rank system, but im gettin the strlok already defined error.
I have read many posts of this error, but i couldnt solve it, please help me.

This is my GM code

http://pastebin.com/m7551c40b

Error @ PAWNO
[code=pawno]
C:\Users\Fourmentel\Desktop\Juegos\ServerSAMP\game modes\sananmoneygrub0.5.pwn(2712) : error 021: symbol already defined: "strtok"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
[/code]

Please help me.



Reply
#2

Go to line 2712. You see strtok function there. Delete it.
Reply
#3

Yes, but if i delete it , my PWNO crashes, its appear a windows error.. :S
Reply
#4

Look now i have delete that line, (( in that line, there was a "{" .. only that ))
Quote:

2718 }
2719
2720 strtok(const string[], &index)
2721 {

And the i delete it, pawno get this errors.

Quote:

C:\Users\Fourmentel\Desktop\Juegos\ServerSAMP\game modes\sananmoneygrub0.5.pwn(2722) : error 021: symbol already defined: "strtok"
C:\Users\Fourmentel\Desktop\Juegos\ServerSAMP\game modes\sananmoneygrub0.5.pwn(2722) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Fourmentel\Desktop\Juegos\ServerSAMP\game modes\sananmoneygrub0.5.pwn(2720) : error 010: invalid function or declaration
C:\Users\Fourmentel\Desktop\Juegos\ServerSAMP\game modes\sananmoneygrub0.5.pwn(2720 -- 2723) : fatal error 107: too many error messages on one line
PD: Thanks for the reply
Reply
#5

pawn Код:
public SendAllFormattedText(playerid, const str[], define)
{
    new tmpbuf[256];
    format(tmpbuf, sizeof(tmpbuf), str, define);
    SendClientMessageToAll(0xFFFF00AA, tmpbuf);
}

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

isStringSame(const string1[], const string2[], len) {
    for(new i = 0; i < len; i++) {
      if(string1[i]!=string2[i])
        return 0;
        if(string1[i] == 0 || string1[i] == '\n')
          return 1;
    }
    return 1;
}
Delete the whole block. So it looks like this:

pawn Код:
public SendAllFormattedText(playerid, const str[], define)
{
    new tmpbuf[256];
    format(tmpbuf, sizeof(tmpbuf), str, define);
    SendClientMessageToAll(0xFFFF00AA, tmpbuf);
}

isStringSame(const string1[], const string2[], len) {
    for(new i = 0; i < len; i++) {
      if(string1[i]!=string2[i])
        return 0;
        if(string1[i] == 0 || string1[i] == '\n')
          return 1;
    }
    return 1;
}
Reply
#6

yes,, its works!!!

thanks!!!!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)