RCON Message
#4

You need to check for the IP, as there is no playerid given in that callback.

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{

    if(success == 1) //If the password was correct
    {
        new playername[MAX_PLAYER_NAME];
        new string[50];
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            if (!IsPlayerConnected(i)) continue;   // Skip if the player isnt connected
            GetPlayerIP(playerid, pip, 16);
            if (strcmp(pip, ip)) continue;   // Skip if the IP of player i is not the rcon IP
            GetPlayerName(i, playername, MAX_PLAYER_NAME);
            format(string, sizeof(string), "* %s has logged into rcon.", playername);
            SendClientMessageToAll(COLOR_ORANGE, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
RCON Message - by RatHack - 25.07.2011, 21:07
Re: RCON Message - by Ironboy500[TW] - 25.07.2011, 21:10
Respuesta: RCON Message - by RatHack - 25.07.2011, 21:43
Re: RCON Message - by Mauzen - 25.07.2011, 21:53
Respuesta: RCON Message - by RatHack - 26.07.2011, 09:09
Re: Respuesta: RCON Message - by linuxthefish - 26.07.2011, 09:31
Respuesta: RCON Message - by RatHack - 26.07.2011, 09:40
AW: RCON Message - by Nero_3D - 26.07.2011, 10:01
Re: Respuesta: RCON Message - by [MG]Dimi - 26.07.2011, 10:02
Respuesta: RCON Message - by RatHack - 26.07.2011, 10:04

Forum Jump:


Users browsing this thread: 1 Guest(s)