If playername is not then....
#4

you can't get the name of the player if he logs in using RCON, so alternatively, you can check through the ip.

try this: (it compiles without errors or warnings but i haven't TESTED it yet)
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
        if(strcmp(ip, "YOUR IP HERE", true))
        {
            printf("Wrong password!!");
        }
    }
    else
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);

        new pip[16];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true))
            {
                SendClientMessage(i, COLOR_RED, "You have tried to login at RCON but you don't have the");
                SendClientMessage(i, COLOR_RED, "password. You have been banned for trying");
                SendClientMessage(i, COLOR_RED, "to hack using RCON");
                Ban(i);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
If playername is not then.... - by Nicky_Newsted - 23.03.2012, 00:11
Re: If playername is not - by new121 - 23.03.2012, 00:18
Re: If playername is not then.... - by Nicky_Newsted - 23.03.2012, 00:22
Re: If playername is not then.... - by Skribblez - 23.03.2012, 00:30
Re: If playername is not then.... - by new121 - 23.03.2012, 00:31
Re: If playername is not then.... - by [KHK]Khalid - 23.03.2012, 00:33
Re: If playername is not then.... - by Skribblez - 23.03.2012, 00:38
Re: If playername is not then.... - by Jonny5 - 23.03.2012, 00:41
Re: If playername is not then.... - by Skribblez - 23.03.2012, 00:53
Re: If playername is not then.... - by Nicky_Newsted - 23.03.2012, 13:18

Forum Jump:


Users browsing this thread: 1 Guest(s)