05.02.2011, 03:53
Just made this based on Jenejl's post:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(GetPVarInt(playerid, "Reconnecting") == 1)
{
new
iStr[30],
iP[16];
GetPVarString(playerid, "RecIP", iP, sizeof(iP));
printf("%s", iP);
format(iStr, sizeof(iStr), "unbanip %s", iP);
SendRconCommand(iStr);
SendRconCommand("reloadbans");
SetPVarInt(playerid, "Reconnecting", 0);
}
return 1;
}
CMD:reconnect(playerid, params[])
{
new
pIP[16],
iStr[25];
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /Reconnect < Player ID >");
new
PID = strval(params);
GetPlayerIp(PID, pIP, sizeof(pIP));
SetPVarInt(PID, "Reconnecting", 1);
SetPVarString(PID, "RecIP", pIP);
format(iStr, sizeof(iStr), "banip %s", pIP);
SendRconCommand(iStr);
SendClientMessage(PID, 0x008080FF, "Reconnecting, please wait..");
return 1;
}
Код:
/Reconnect < Player ID >