unknown errors!
#1

hey i am getting this two errors idk whats the problem

pawn Код:
new PlayerName[MAX_PLAYER_NAME], string[128]; //ERROR LINE 5303
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
    //-----------------------------------------------------
    //-----------------------------------------------------
    //-----------------------------------------------------
    if(ServerInfo[NameKick] == 1) {
        for(new s = 0; s < BadNameCount; s++) {
            if(!strcmp(BadNames[s],PlayerName,true)) {
                SendClientMessage(playerid,red, "Your name is on our black list, you have been kicked.");
                format(string,sizeof(string),"%s ID:%d was auto kicked. (Reason: Forbidden name)",PlayerName,playerid);
                SendClientMessageToAll(grey, string);  print(string);
                SaveToFile("KickLog",string);  Kick(playerid);
                return 1;
            }
        }
    }
    //-----------------------------------------------------
    if(ServerInfo[PartNameKick] == 1) {
        for(new s = 0; s < BadPartNameCount; s++) {
            new pos;
            while((pos = strfind(PlayerName,BadPartNames[s],true)) != -1) for(new i = pos, j = pos + strlen(BadPartNames[s]); i < j; i++)
            {
                SendClientMessage(playerid,red, "Your name is not allowed on this server, you have been kicked.");
                format(string,sizeof(string),"%s ID:%d was auto kicked. (Reason: Forbidden name)",PlayerName,playerid);
                SendClientMessageToAll(grey, string);  print(string);
                SaveToFile("KickLog",string);  Kick(playerid);
                return 1;
            }
        }
    }
    //-----------------------------------------------------
    if(ServerInfo[Locked] == 1) {
        PlayerInfo[playerid][AllowedIn] = false;
        SendClientMessage(playerid,red,"Server is Locked!  You have 20 seconds to enter the server password before you are kicked!");
        SendClientMessage(playerid,red," Type /password [password]");
        LockKickTimer[playerid] = SetTimerEx("AutoKick", 20000, 0, "i", playerid);
    }
    //-----------------------------------------------------
    if(strlen(dini_Get("ladmin/config/aka.txt", tmp3)) == 0) dini_Set("ladmin/config/aka.txt", tmp3, PlayerName);
    else
    {
        if( strfind( dini_Get("ladmin/config/aka.txt", tmp3), PlayerName, true) == -1 )
        {
            format(string,sizeof(string),"%s,%s", dini_Get("ladmin/config/aka.txt",tmp3), PlayerName);
            dini_Set("ladmin/config/aka.txt", tmp3, string);
        }
    }

pawn Код:
new PlayerName[MAX_PLAYER_NAME];//ERROR LINE 5561
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

    if(PlayerInfo[playerid][LoggedIn] == 1) SavePlayer(playerid);
    if(udb_Exists(PlayerName2(playerid))) dUserSetINT(PlayerName2(playerid)).("loggedin",0);
    PlayerInfo[playerid][LoggedIn] = 0;
    PlayerInfo[playerid][Level] = 0;
    PlayerInfo[playerid][Jailed] = 0;
    PlayerInfo[playerid][Frozen] = 0;

    if(PlayerInfo[playerid][Jailed] == 1) KillTimer( JailTimer[playerid] );
    if(PlayerInfo[playerid][Frozen] == 1) KillTimer( FreezeTimer[playerid] );
    if(ServerInfo[Locked] == 1) KillTimer( LockKickTimer[playerid] );
    if(PlayerInfo[playerid][pCar] != -1) CarDeleter(PlayerInfo[playerid][pCar]);

errors:

pawn Код:
C:\Users\Ryz\Desktop\codwwh.pwn(5303) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Users\Ryz\Desktop\codwwh.pwn(5561) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
Reply
#2

it's a warning and it's not that bad so just leave it as it is
Reply
#3

You have used "PlayerName" variables many times in one function, that's why,
Suggesting you to
pawn Код:
new name[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
new name3[MAX_PLAYER_NAME];
//like that.
P.S : They're not errors, warnings only will not effect on your compiling.
Reply
#4

hmm ok . thanks for reply
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)