SA-MP Forums Archive
BlockIpAddress problem - 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: BlockIpAddress problem (/showthread.php?tid=573763)



BlockIpAddress problem - BGTrucker - 10.05.2015

Well,I was trying to make reconnect cmd.I have seen a tutorial here in the forumsa about this using banip rcon cmd.But I was thinking of making it using BlockIpAddress function,but it doesnt seem to work.It seems that the function doesnt block the IP FOR the amount of time I have set,but AFTER it.Also I noticed that it doesnt do anything if I set the time to less than 9848 ms.My idea is the IP to get unblocked while the player tries to re-establish the connection,but it directly gives the "You are banned from this server." text.So,is it even possible to use BlockIpAddress for reconnecting or I should use the old method using banip rcon cmd.Here is my script:
pawn Код:
CMD:rc(playerid,params[]){
    new player2,IP[16];
    if(PInfo[playerid][Lvl]>=4){
        if(sscanf(params,"u",player2)) player2=playerid;
        format(Msg,256,"%s is reconnecting.",PInfo[player2][PName]);
        SendClientMessageToAll(-1,Msg);
        GetPlayerIp(player2,IP,16);
        BlockIpAddress(IP,9848);
        format(Msg,256,"Blocking %s",IP);
        SendClientMessageToAll(-1,Msg);}
    else return 0;
    return 1;}



Re: BlockIpAddress problem - fuckingcruse - 10.05.2015

Everything seems good , once check your enums..