SA-MP Forums Archive
Simple Questin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Simple Questin (/showthread.php?tid=493998)



Simple Questin - DarkLored - 11.02.2014

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;
    }



Re: Simple Questin - CuervO - 11.02.2014

Do you correctly save and load the banned variable?


Re: Simple Questin - DarkLored - 11.02.2014

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


Re: Simple Questin - CuervO - 11.02.2014

Apply a 1s timer before kicking the player.


Re: Simple Questin - SickAttack - 11.02.2014

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);
}