[HELP] Ban Player if they type wrong Rcon pass.
#1

So far I have this
pawn Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {

        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {   new str[128], name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                format(str, sizeof(str), "{37DB45}%s {FF0000}was auto-banned by {0000FF}GOD{FF0000}. Reason: {DB881A}Attepmt to hack Rcon{FF0000}.", name);
                SendClientMessageToAll(0xFFFFFFFF,str);
                SendClientMessage(i, 0xFFFFFFFF, "{FF0000}Wrong Password. {0xFFFFFFFF}You are automatically {FF0000}banned."); //Send a message
                SendClientMessage(i, 0xFFFFFFFF, "{DB881A}Send me an e-mail at {FF0000}MGatUA{37DB45}@{FF0000}Mail{37DB45}.{FF0000}ru{DB881A} for an unban."); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
it says
Code:
C:\Users\Vlad\Desktop\WorldRP\filterscripts\rcon.pwn(177) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
PLEASE! Help me. I will +REP any one who will help me.
Thanx in advanced.
Reply
#2

Replace
pawn Code:
GetPlayerName(playerid, name, sizeof(name));
With
pawn Code:
GetPlayerName(i, name, sizeof(name));
Reply
#3

Yea thx +REP 2. (I like your Fly.inc)
Reply
#4

You are welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)