SA-MP Forums Archive
Range ban. - 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: Range ban. (/showthread.php?tid=517050)



Range ban. - Laure - 03.06.2014

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



Re: Range ban. - Threshold - 03.06.2014

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


Re: Range ban. - Laure - 03.06.2014

All good its KickTime


Respuesta: Range ban. - Shura - 03.06.2014

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



Re: Range ban. - Laure - 03.06.2014

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


Respuesta: Range ban. - Shura - 03.06.2014

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.


Re: Range ban. - Threshold - 03.06.2014

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