OnPlayerConnect Problem...
#1

pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerBanned(playerid))
    {
        Kick(playerid); //I tried to kick him before he get that message, Dident work...
    }
    else
    {
        for(new i;i<MAX_PLAYERS;i++)
        {
            if(IsPlayerAdmin(i) || PlayerData[i][AdminLevel] > 1)
            {
                print("[DEBUG]: Joined");
                format(string,sizeof string,"%s(%d) Has joined %s (IP: %s)", PlayerName(playerid), playerid, SERVER_NAME, PlayerIP(playerid));
                SendClientMessageToAdmins(COLOR_GREY, string);
                return 1;
            }
            else
            {
                print("[DEBUG]: Joined");
                format(string,sizeof string,"%s(%d) Has joined %s", PlayerName(playerid), playerid, SERVER_NAME);
                SendClientMessageToAll(COLOR_GREY, string);
                return 1;
            }
        }
        return 1;
    }
    return 1;
}

stock IsPlayerBanned(playerid)
{
    new queue[128];
    format(queue, sizeof(queue), "SELECT * FROM `PlayerBans` WHERE IP= '%s'", PlayerIP(playerid));
    mysql_query(queue);
    mysql_store_result();
    if(mysql_num_rows())
    {
        mysql_free_result();
        return 1;
    }
    mysql_free_result();
    return 0;
}

/*

The problem is:

If a banned player try connect, then i get a message like this
" (1) Has joined <MyServer>"

But i want it to if a banned player try to connect, it should dont appear any text

*/
Reply


Messages In This Thread
OnPlayerConnect Problem... - by Unknown123 - 06.03.2011, 00:32
Re: OnPlayerConnect Problem... - by grand.Theft.Otto - 06.03.2011, 00:42
Re: OnPlayerConnect Problem... - by admantis - 06.03.2011, 00:46
Re: OnPlayerConnect Problem... - by Unknown123 - 06.03.2011, 00:47
Re: OnPlayerConnect Problem... - by Marricio - 06.03.2011, 00:50
Re: OnPlayerConnect Problem... - by admantis - 06.03.2011, 00:52
Re: OnPlayerConnect Problem... - by Unknown123 - 06.03.2011, 00:52
Re: OnPlayerConnect Problem... - by admantis - 06.03.2011, 00:54
Re: OnPlayerConnect Problem... - by Unknown123 - 06.03.2011, 00:55
Re: OnPlayerConnect Problem... - by admantis - 06.03.2011, 01:00

Forum Jump:


Users browsing this thread: 1 Guest(s)