SA-MP Forums Archive
How do I detect RCON login? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do I detect RCON login? (/showthread.php?tid=403317)



How do I detect RCON login? - jakejohnsonusa - 29.12.2012

I am wondering how I can make a message to all admins when someone logins into RCON... for security reasons. How do I detect if someone logs-in?

Thanks: jakejohnsonusa


AW: How do I detect RCON login? - Blackazur - 29.12.2012

With "OnRconLoginAttempt", example:

Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("Failed Rcon Login. IP: %s using Passwort%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
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}



Re: How do I detect RCON login? - Mr.Anonymous - 29.12.2012

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
        SendClientMessageToAll(0xFFFFFFFF, "FAKE RCON LOGIN!!!");
    }
    return 1;
}



Re: How do I detect RCON login? - jakejohnsonusa - 29.12.2012

Thanks guys!

+ 1 Rep!


Re: How do I detect RCON login? - a.z.a.r - 29.12.2012

fix
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
        SendClientMessageToAll(0xFFFFFFFF, "FAKE RCON LOGIN!!!");
        Ban(playerid)//if i were you i'd strraight away add this.
    }
    return 1;
}