Reconnect someone?
#1

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

Код:
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?
Reply
#3

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!
Reply
#4

This worked, thanks alot Twizted!

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)