When player connect (if banned) shows dialog that he is banned!
#1

Hello!

I wanna ask how to make that when some banned player join my server it opens a dialog box that he is banned (reason,IP...) and then Server closed the connection.

Like this:

Reply
#2

pawn Code:
new bool: Banned[MAX_PLAYERS char];
CMD:ban(playerid, params[])
{
    if(!isnull(params)) Banned[params] = true;
    return 1;
}

OnPlayerConnect(playerid)
{
    if(Banned[playerid])
    {
        SendClientMessage(playerid, -1, " You are banned ! ");
        return Kick(playerid);
    }
}
Make your own ban command, this is example, if you don't understand I'll make it later !
Reply
#3

Quote:
Originally Posted by erminpr0
View Post
pawn Code:
new bool: Banned[MAX_PLAYERS char];
CMD:ban(playerid, params[])
{
    if(!isnull(params)) Banned[params] = true;
    return 1;
}

OnPlayerConnect(playerid)
{
    if(Banned[playerid])
    {
        SendClientMessage(playerid, -1, " You are banned ! ");
        return Kick(playerid);
    }
}
Make your own ban command, this is example, if you don't understand I'll make it later !
Use char keyword only if you know how to use it.

The declaration is fine but the rest are not:
pawn Code:
Banned[params] = true;
params is an array and it expects an integer value instead. Also it must be used with {} and not with []. So this:
pawn Code:
if(Banned[playerid])
becomes:
pawn Code:
if(Banned{playerid})
But still.. you need a ban system that will assign whether the player is banned to the variable and act accordingly. There are many filterscripts/tutorials/includes that does what SplinteX wants, just search!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)