Ban Message
#1

I want if you are banned, and going to log back in you will get a message.
But i still dont know how that works.

This is my enum:
pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pVip,
    pKills,
    pDeaths
}

new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#2

You will use a saved bool to every account to see if they are banned or not, and on public OnPlayerConnect (don't know if it is that) You will check if they have that bool set to false or true and then send message and kick them or let them login.
I think that is how you are doing it ^^.
Reply
#3

how to make a bool?

EDIT: i doesn't give me the message. I have this:

pawn Код:
enum pInfo
{
    bool:pBanned,
    pPass,
    pCash,
    pAdmin,
    pVip,
    pKills,
    pDeaths,
}
pawn Код:
if(PlayerInfo[playerid][pBanned] == true)
    {
        SendClientMessage(playerid, COLOR_RED, "You are banned, please make a unban appeal if you think you are wrongly banned.");
        Kick(playerid);
    }
And this is in mine ban command.
pawn Код:
Ban(id);
    PlayerInfo[id][pBanned] = true;
Reply
#4

Quote:
Originally Posted by MechaTech
Посмотреть сообщение
how to make a bool?

EDIT: i doesn't give me the message. I have this:

pawn Код:
enum pInfo
{
    bool:pBanned,
    pPass,
    pCash,
    pAdmin,
    pVip,
    pKills,
    pDeaths,
}
pawn Код:
if(PlayerInfo[playerid][pBanned] == true)
    {
        SendClientMessage(playerid, COLOR_RED, "You are banned, please make a unban appeal if you think you are wrongly banned.");
        Kick(playerid);
    }
And this is in mine ban command.
pawn Код:
Ban(id);
    PlayerInfo[id][pBanned] = true;
I don't know how to work with enums :S but it looks like you have done something wrong with the enum/saving system, Are you sure you have set the account to banned when enter the server?
Reply
#5

Yes, if i want to connect to the server it says: Server Closed Connection, but it doesn't show te messages.
Reply
#6

you don't need to make the pBanned as bool you can make it as integer.

EDIT:

Kicking player OnPlayerConnect will make player reconnect everytime set a timer that will kick a banned player
Reply
#7

Quote:
Originally Posted by Romel
Посмотреть сообщение
you don't need to make the pBanned as bool you can make it as integer.
Making it as a bool saves computer power and memory
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)