How to do rcon ban with time out
#1

Hi i want to do Rcon ban but not write Kicked/Banned I need to write Timed outed( i don't want to change reason). This is like When you login in rcon and 3 incorennct password timed out and banned...
Reply
#2

pawn Код:
#include <a_samp>

new Attemp[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Attemp[playerid] = 0;
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    Attemp[playerid] = 0;
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
        new string[128];
        if(!success)
        {
            new pName[MAX_PLAYER_NAME];
            for(new i=0; i<MAX_PLAYERS; i++)
            {
                        if(Attemp[i] > 2)
                        {
                            format(string, 256, "SERVER: %s left the server [Timeout]", pName);
                            SendClientMessageToAll(-1, string);
                            Attemp[i] ++;
                            Ban(i); // this will ban him use /kick if you want to kick him Kick(i);
                        }
                        return 1;
            }
        }
        else
        {
            for(new i=0; i<MAX_PLAYERS; i++)
            {
                Attemp[i] = 0;
            }
        }
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)