Range ban.
#1

The server is supposed to kick a player checking if he is rangebanned but instead the one gets the message of rangeban and in a while appears a login dialog so he could log again, the main problem is the server is supposed to kick the player but it doesnt do so.Thats my code which check for rangeban.
pawn Код:
if(CheckBan(string) == 1 && !dini_Int(file, "Whitelisted"))
    {
        SetPlayerName(playerid, "BannedPlayer");
        SendClientMessage(playerid, COLOR_DARKRED, "{FFFFFF}Your range is banned from this server. Request getting whitelisted in the forums");
        SetTimerEx("KickTime", 100, false, "i", playerid);
        return 1;
    }
Reply
#2

Is the timer name correct? Did you call it 'KickTime' or 'KickTimer'??
Reply
#3

All good its KickTime
Reply
#4

you must accommodate the / kick men.

Код:
function KickFix(playerid) { Kick(playerid); }
then the stock:
Код:
stock Expulsar(playerid) return SetTimerEx("KickFix", 1000, 0, "d", playerid);
Its function now
Код:
if(CheckBan(string) == 1 && !dini_Int(file, "Whitelisted"))
    {
        SetPlayerName(playerid, "BannedPlayer");
        SendClientMessage(playerid, COLOR_DARKRED, "{FFFFFF}Your range is banned from this server. Request getting whitelisted in the forums");
        Expulsar(playerid); //new function
        return 1;
    }
Reply
#5

Can you explain about it please? I want to learn too.
Reply
#6

sry for my language.

You must create it, and thus assigns a time to kick, then call the function "Expulsar"

I hope you understand me. In this case you should change all the "kick" to "Expulsar" and so the kick message appears.
Reply
#7

There is no need to create a stock function to execute a single line.
pawn Код:
if(CheckBan(string) == 1 && !dini_Int(file, "Whitelisted"))
    {
        SetPlayerName(playerid, "BannedPlayer");
        SendClientMessage(playerid, COLOR_DARKRED, "{FFFFFF}Your range is banned from this server. Request getting whitelisted in the forums");
        SetTimerEx("KickTime", 200, false, "i", playerid);
        return 1;
    }

//At the bottom of your script:
forward KickTime(playerid);
public KickTime(playerid) return Kick(playerid);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)