[Help] Server closed the connection on connecting
#1

Hi,
I've made an kick script
When i kick myself (for testing) it works correctly but when i try to connect again, server says "Server closed the connection.".
PHP код:
CMD:kick(playeridparams[])
{
    new
        
targetid,
        
Reason[50],
        
AdminName[MAX_PLAYERS],
        
TargetName[MAX_PLAYER_NAME],
        
kickmsg[128];
    if(
PlayerInfo[pAdmin][playerid]>=1)
    {
         if(
sscanf(params"us[50]"targetidReason)) return SendClientMessage(playerid0xE90A0AFF"[CMD] /kick [playerid] [reason]");
        if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid0xE90A0AFF"[ERROR] Invalid player ID.");
        
GetPlayerName(playeridAdminNamesizeof(AdminName));
        
GetPlayerName(targetidTargetNamesizeof(TargetName));
        
format(kickmsgsizeof(kickmsg), "[ADMIN] Admin %s has kicked %s [Reason: %s]"AdminNameTargetNameReason);
        
SendClientMessageToAll(0xE90A0AFFkickmsg);
        
SetTimerEx("KickPlayer"5001"i"playerid);
    }
    else
    {
        
SendClientMessage(playerid0xE90A0AFF"[ERROR] You are not authorized.");
    }
    return 
1;

PHP код:
forward KickPlayer(playerid);
public 
KickPlayer(playerid)
{
    
Kick(playerid);
    return 
1;

In
Код:
Kick(playerid);
what should i write? (playerid or targetid?)
[/PHP]
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)