Simple Questin
#1

So i made a ban system but when i ban myself to test if the player gets banned it dosent show the ban message
i have an exsample that i made but it dosent show the ban message before being kicked

here is the code
pawn Код:
if(pInfo[playerid][Banned] == 1)
    {
       SendClientMessage(playerid,COLOR_RED,"YOU ARE BANNED FROM THIS SERVER");
       Kick(playerid);
       return 1;
    }
Reply
#2

Do you correctly save and load the banned variable?
Reply
#3

Yes but i just want it to show the message that he is banned its actually not showing the message but the player is getting kicked correctly

i dont know if you got what i have asked the problem isnt that he isnt getting banned it dosent show the message when he logs in
Reply
#4

Apply a 1s timer before kicking the player.
Reply
#5

You need to set a timer. The message won't show to the player who is banned because the player is kicked immediately.

pawn Код:
if(pInfo[playerid][Banned] == 1)
{
    SendClientMessage(playerid,COLOR_RED,"YOU ARE BANNED FROM THIS SERVER");
    SetTimerEx("KickPlayer", 200, false, "i", playerid); // Player timer - Don't set a regular timer, if you do id 0 will only be kicked
    return 1;
}

forward KickPlayer(playerid);
public KickPlayer(playerid)
{
    Kick(playerid);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)