SA-MP Forums Archive
Reconnect someone? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Reconnect someone? (/showthread.php?tid=276134)



got it - swieberdevos - 12.08.2011

I saw in a server that they can reconnect players..
How to reconnect a player?


Re: Reconnect someone? - Twizted - 12.08.2011

Код:
OnPlayerConnect(playerid)
{
    new IP[20];
    GetPlayerIp(playerid,IP,sizeof(IP));
    SetPVarString(playerid,"ip",IP);
}
OnPlayerBugged(playerid)
{
    SetPVarInt(playerid,"bugban",1);
    new IP[24];
    GetPlayerIp(playerid,IP,sizeof(IP));
    format(IP,sizeof(IP),"banip %s",IP);
    SendRconCommand(IP);
}
OnPlayerDisconnect(playerid)
{
    if(GetPVarInt(playerid,"bugban") == 1)
    {
        new string[24];
        GetPVarString(playerid,"ip",string,sizeof(string));
        format(string,sizeof(string),"unbanip %s",string);
        SendRconCommand(string);
        SendRconCommand("reloadbans");
    }
}
Is this what you mean?


AW: Reconnect someone? - samtey - 12.08.2011

Well, you can KICK a person! If you use ZCMD:

PHP код:
   CMD:kick(playeridparams[])
    {
        if(
PlayerInfo[playerid][pAdmin] >= 1) {
            new 
PID;
            if(
sscanf(params"u"PID)) return SendClientMessage(playeridCOLOR_GREY"USAGE: /kick [playerid] [reason]");
            if(!
IsPlayerConnected(PID))
                return 
SendClientMessage(playeridCOLOR_GREY"Player is not connected!");
            
Kick(PID);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"You are not an administrator, so you can't use this command!");
        }
        return 
1;
    } 
You can easily convert it into strcmp if you need!


Re: Reconnect someone? - swieberdevos - 12.08.2011

This worked, thanks alot Twizted!

@Samtey, I know how to make a kick command :P


Re: Reconnect someone? - Twizted - 12.08.2011

I will always help If you need; +1 If you find fair!