/reconnect
#8

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 >
Reply


Messages In This Thread
/reconnect - by Unknown123 - 05.02.2011, 00:59
Re: /reconnect - by Lorenc_ - 05.02.2011, 01:01
Re: /reconnect - by Kitten - 05.02.2011, 01:02
Re: /reconnect - by Unknown123 - 05.02.2011, 01:04
Re: /reconnect - by Lorenc_ - 05.02.2011, 01:24
Re: /reconnect - by Unknown123 - 05.02.2011, 01:39
Re: /reconnect - by Kitten - 05.02.2011, 01:53
Re: /reconnect - by [L3th4l] - 05.02.2011, 03:53

Forum Jump:


Users browsing this thread: 6 Guest(s)