Best way to reconnect a player (banip/unbanip)
#1

Hello, I have a reconnect command but it doesn't seem to be working correctly. It disconnects but it says the player is banned, if I use a CLEO mod to reconnect, it'll reconnect after around 10 attempts, so it makes me believe this is caused by additional attack security measures added in 0.3z.

Code:

CMD:
pawn Код:
CMD:reconnect(playerid, params[])
{
    if( gPlayerInfo[playerid][pAlevel] < 1) return accessdenied(playerid);
    new target, reason[40], string[80];
    if(sscanf(params, "us[40]", target, reason)) return SendUsage(playerid, "USAGE: /reconnect [ID/name] [reason]");
    if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, notconnected);
    if(strlen(reason) > 40)
        return SendClientMessage(playerid, COLOR_RED, "Reason must be below 40 characters.");
    GetPlayerIp(target, ReconnectPIP[target], 16);
    ssstring("[RECONNECT] %s was forced to reconnect by %s. [reason: %s]", gPlayerInfo[target][pName], gPlayerInfo[playerid][pName], reason);
    SendClientMessageToAll(COLOR_RED, ssstring);
    for (new i=0;i<=20;i++) SendClientMessage(target, -1, " ");
    String("Administrator %s has forced you to reconnect. [reason: %s]", gPlayerInfo[playerid][pName], reason);
    GameTextForPlayer(target, "~w~please wait...~n~~r~reconnecting to server", 5000, 3);
    SendClientMessage(target, COLOR_RED, string);
    ssstring("banip %s", ReconnectPIP[target]);
    SendRconCommand(ssstring);
    IsReconnecting[target] = true;
    return 1;
}
OnPlayerDisconnect:
Код:
	if(IsReconnecting[playerid])
	{
		new string[30];
		format(string, sizeof(string), "unbanip %s", ReconnectPIP[playerid]);
		SendRconCommand(string);
		SendRconCommand("reloadbans");
		IsReconnecting[playerid] = false;
		print(string);
	}
Reply


Messages In This Thread
Best way to reconnect a player (banip/unbanip) - by rymax99 - 07.09.2014, 07:29
Re: Best way to reconnect a player (banip/unbanip) - by BroZeus - 07.09.2014, 09:50
Re: Best way to reconnect a player (banip/unbanip) - by rymax99 - 07.09.2014, 19:28
Re: Best way to reconnect a player (banip/unbanip) - by Pottus - 07.09.2014, 20:45
Re: Best way to reconnect a player (banip/unbanip) - by Stinged - 07.09.2014, 20:54

Forum Jump:


Users browsing this thread: 1 Guest(s)