RCON Login warning system, what is wrong here?
#2

It should be
pawn Код:
if(strcmp(cheaterIp, ip, true) == 0)
Also you missed to check if the given ip is even on the server or if more than one player has this ip (same house)

Simply because of the second case I wouldn't use this public at all and implement all necessary rcon commands into the admin system

Cleaned your code a bit
PHP код:
SendAdminMessage(colorstring[]) {
    for(new 
i<= MAX_PLAYERS; ++i) {
        if(
PlayerInfo[i][pAdmin] > 0) {
            
SendClientMessage(icolorstring);
        }
    }
}
public 
OnRconLoginAttempt(ip[], password[], success) {
    new
        
playerid INVALID_PLAYER_ID,
        
tmp[128]
    ;
    for(new 
i<= MAX_PLAYERS; ++i) {
        if(
GetPlayerIp(itmp16)) {
            if(
strcmp(iptmptrue) == 0) {
                if(
playerid != INVALID_PLAYER_ID) {
                    return 
false// 2 players with this ip
                
}
                
playerid i;
            }
        }
    }
    if(!
GetPlayerName(playeridtmpMAX_PLAYER_NAME)) {
        return 
false// ip not playing in the server
    
}
    if(!
success) {
        
format(tmpsizeof tmp"** Warning: {FFFFFF}%s (%d) tried to RCON login with the password '%s' and fails."tmpplayeridpassword);
        
SendAdminMessage(COLOR_ACHATtmp);
    } else {
        if(
PlayerInfo[playerid][pAdmin] > 0)) {
            
format(tmpsizeof tmp"** Admin %s (%d) has successfully RCON logged in."tmpplayerid);
            
SendAdminMessage(COLOR_ACHATtmp);
        } else {
            
format(tmpsizeof tmp"** %s has been automatically kicked from the server for RCON logging in not being an admin."tmp);
            
SendClientMessageToAll(COLOR_ERRORtmp);
            
DelayedKick(playerid);
        }
    }    
    return 
true;

Reply


Messages In This Thread
RCON Login warning system, what is wrong here? - by hydravink - 27.08.2015, 23:18
AW: RCON Login warning system, what is wrong here? - by Nero_3D - 28.08.2015, 11:33
Re: RCON Login warning system, what is wrong here? - by hydravink - 28.08.2015, 18:47

Forum Jump:


Users browsing this thread: 1 Guest(s)