Can some help me with these errors and warning?
#1

Ok I have 4 errors but the 4th one just says it just has too many errors in one line. I've tried adding brackets to a lot of places but no luck. Hopefully someone out there knows whats wrong. Here is the errors with the code.

Код:
C:\Users\Owner\Desktop\NERP\gamemodes\NewEvo-RP.pwn(724) : warning 201: redefinition of constant/macro (symbol "strcpy(%0,%1,%2)")
C:\Users\Owner\Desktop\NERP\gamemodes\NewEvo-RP.pwn(1341) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\NERP\gamemodes\NewEvo-RP.pwn(1341) : warning 215: expression has no effect
C:\Users\Owner\Desktop\NERP\gamemodes\NewEvo-RP.pwn(1341) : error 001: expected token: ";", but found ")"
C:\Users\Owner\Desktop\NERP\gamemodes\NewEvo-RP.pwn(1341) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\NERP\gamemodes\NewEvo-RP.pwn(1341) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 724: (Warning)
Код:
#define strcpy(%0,%1,%2) \ strcat((%0[0] = '\0', %0), %1, %2)

Here is where the errors are happening:
Код:
stock InvalidNameCheck(playerid)
{
    new arrForbiddenNames[][] = {
            "com1", "com2", "com3", "com4",
            "com5", "com6", "com7", "com8",
            "com9", "lpt4", "lpt5", "lpt6",
            "lpt7", "lpt8", "lpt9", "nul",
            "clock$", "aux", "prn", "con",
            "InvalidNick"
     };

    new i = 0;
    while(i < sizeof(arrForbiddenNames))
    { 
        if(strcmp(arrForbiddenNames[i++], GetPlayerNameExt(playerid), true) == 0)//Line 1341
        {
            SetPlayerName(playerid, "InvalidNick");
            SendClientMessage(playerid, COLOR_RED, "You have been kicked & logged for using a forbidden username.");
            Kick(playerid);
            return 0;
        }
    } 
    return 1;
}
Reply
#2

Delete this - Posted by wrong.
Reply
#3

Try this definition
pawn Код:
#define strcpy(%0,%1,%2)   strcat((%0[0] = EOS, %0), %1, %2 + 1)
Or
pawn Код:
stock strcpy(dest[], const source[], const dsize = sizeof dest, const ssize = sizeof source)
{
        if(ssize < dsize) {
                memcpy(dest, source, 0, ssize*(cellbits/8), dsize);
                dest[ssize] = '\0';
        } else {
                memcpy(dest, source, 0, (dsize-1)*(cellbits/8), dsize);
                dest[dsize-1] = '\0';
        }
}
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
If strcpy is already defined, remove the second one.

As for the other error, how is GetPlayerNameExt defined?
#define GetPlayerNameExt(playerid)
Reply
#5

Quote:
Originally Posted by ArmandoRamiraz
Посмотреть сообщение
#define GetPlayerNameExt(playerid)


Delete that "define" and in your script (near other stocks) add this:
Код:
stock GetPlayerNameExt( playerid )
{
    new lsName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, lsName, MAX_PLAYER_NAME );
    return lsName;
}
Reply
#6

Now I get 26 errors...
Reply
#7

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Код:
stock GetPlayerNameExt( playerid )
{
    new lsName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, lsName, MAX_PLAYER_NAME );
    return lsName;
}
I have that already too,


If i #define GetPlayerNameExt then it only shows 4 errors. But if i take it out i get 26.


Even now I still get undefined symbol GetPlayerNameExt.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)