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;
}
if(IsReconnecting[playerid]) { new string[30]; format(string, sizeof(string), "unbanip %s", ReconnectPIP[playerid]); SendRconCommand(string); SendRconCommand("reloadbans"); IsReconnecting[playerid] = false; print(string); }
BlockIpAddress(PLAYER_IP, 5);//blocks ip for 5ms
Why not just kick them and let them reconnect through the client?
Also, you didn't actually ask any questions in that post, which is generally required when "asking" for help. |