[Help] Server closed the connection on connecting
#5

Quote:
Originally Posted by MarvinPWN
Посмотреть сообщение
Write it like this:
PHP код:
CMD:kick(playerid,params[])
{
    new 
targetid,Reason[50],AdminName[MAX_PLAYER_NAME],TargetName[MAX_PLAYER_NAME],kickmsg[145];
    if(
PlayerInfo[pAdmin][playerid] >= 1)
    {
        if(
sscanf(params,"us[50]",targetid,Reason))return SendClientMessage(playerid,0xE90A0AFF,"[CMD] /kick [playerid] [reason]");
        if(!
IsPlayerConnected(targetid))return SendClientMessage(playerid,0xE90A0AFF,"[ERROR] Invalid player ID.");
        
GetPlayerName(playerid,AdminName,MAX_PLAYER_NAME);
        
GetPlayerName(targetid,TargetName,MAX_PLAYER_NAME);
        
format(kickmsg,sizeof kickmsg,"[ADMIN] Admin %s has kicked %s [Reason: %s]",AdminName,TargetName,Reason);
        
SendClientMessageToAll(0xE90A0AFF,kickmsg);
        
SetTimerEx("KickPlayer",500,0,"i",targetid);
        return 
1;
    }
    
SendClientMessage(playerid,0xE90A0AFF,"[ERROR] You are not authorized.");
    return 
1;
}
forward KickPlayer(playerid);
public 
KickPlayer(playerid)
{
    
Kick(playerid);
    return 
1;

You have to start the timer with targetid and the repeat as 0.
Fixed.
Thanks, +REP
Reply


Messages In This Thread
[Help] Server closed the connection on connecting - by javad - 18.08.2015, 08:30
Re: [Help] Server closed the connection on connecting - by MarvinPWN - 18.08.2015, 08:45
Re: [Help] Server closed the connection on connecting - by CNMike - 18.08.2015, 08:47
Re: [Help] Server closed the connection on connecting - by MarvinPWN - 18.08.2015, 08:50
Re: [Help] Server closed the connection on connecting - by javad - 18.08.2015, 09:33

Forum Jump:


Users browsing this thread: 1 Guest(s)