24.03.2015, 05:48
Okay so, I got this kick command, BUT, when I kick the player, it just tells them 'Server Closed the Connection.', but they don't get the reason for me kicking them. How can I make it to where they see the reason?
Код:
CMD:kick(playerid, params[]) { if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands."); new giveplayerid, string[128], Reason; if(!sscanf(params, "us[128]", giveplayerid, Reason)) { if(IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "AdmCmd: %s has been kicked by %s. Reason: %s", PlayerName(giveplayerid), PlayerName(playerid), Reason); SendClientMessageToAll(COLOR_ORANGE, string); format(string, sizeof(string), "KICK: %s has been kicked by %s (%s). Reason: %s", PlayerName(giveplayerid), PlayerName(playerid), GetPlayerIpEx(playerid), Reason); Log("Logs/Kick.log", string); Kick(giveplayerid); } else { SendClientMessage(playerid, COLOR_GREY, "Invalid Player Specified."); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Kick [Player Id] [Reason]"); } return 1; }