Kick not showing the reason
#1

pawn Код:
CMD:kick(playerid, params[])
{
    new playerb, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(sscanf(params, "us[128]", playerb, params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
    if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "You can't kick NPCs out of the server.");
    if(PlayerInfo[playerid][pAdmin] < PlayerInfo[playerb][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
    format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: %s has been kicked by %s (%s), reason: %s", RPN(playerb), RPN(playerid), RPIP(playerid), params);
    Log("logs/kick.log", string);
    Kick(playerb);
    return 1;
}
It's just shows: server closed the connection, Not showing the reason.
Thanks in advanced
Reply
#2

pawn Код:
CMD:kick(playerid, params[])
{
    new playerb, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(sscanf(params, "us[128]", playerb, params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
    if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "You can't kick NPCs out of the server.");
    if(PlayerInfo[playerid][pAdmin] < PlayerInfo[playerb][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
    format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: %s has been kicked by %s (%s), reason: %s", RPN(playerb), RPN(playerid), RPIP(playerid), params);
    Log("logs/kick.log", string);
    KickFix(playerb);
    return 1;
}
forward KickFix(playerid);public KickFix(playerid)
{
SetTimerEx("KickPlayer", 1000, false, "i", playerid);
return 1;
}
forward KickPlayer(playerid); public KickFix(playerid)
{
Kick(playerid);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)