07.09.2014, 07:29
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:
OnPlayerDisconnect:
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;
}
Код:
if(IsReconnecting[playerid]) { new string[30]; format(string, sizeof(string), "unbanip %s", ReconnectPIP[playerid]); SendRconCommand(string); SendRconCommand("reloadbans"); IsReconnecting[playerid] = false; print(string); }