27.02.2014, 16:15
Hello, is a reconnect command to reconnect someone, still possible in 0.3z?
new bool:reconnecting[MAX_PLAYERS];
new playersip[MAX_PLAYERS][16];
public OnPlayerConnect(playerid)
{
reconnecting[playerid] = false;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/reconnectme", true) == 0)
{
if(reconnecting[playerid]) return SendClientMessage(playerid, 0xFF0000FF, "You are already being reconnected, please wait.");
SendClientMessage(playerid, 0xFFFF00FF, "You are now being reconnected. Please wait while the server reconnects you.");
GetPlayerIp(playerid, playersip[playerid], 16);
reconnecting[playerid] = true;
new rconmsg[25];
format(rconmsg, sizeof(rconmsg), "banip %s", playersip[playerid]);
SendRconCommand(rconmsg);
return 1;
}
return 0;
}
public OnPlayerDisconnect(playerid, reason)
{
if(reconnecting[playerid])
{
new rconmsg[25];
format(rconmsg, sizeof(rconmsg), "unbanip %s", playersip[playerid]);
SendRconCommand(rconmsg);
SendRconCommand("reloadbans");
}
return 1;
}