2021-04-02, 10:07 AM
Code:
CMD:kick(playerid, params[])
{
new target_id, reason[24], kick_string[200];
if (PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You are not allowed to use this command!");
if (sscanf(params, "us[24]", target_id, reason)) return SCM(playerid, COLOR_RED, "Usage: /kick [playerid/name] [reason]");
if (!IsPlayerConnected(target_id) return SCM(playerid, COLOR_RED, "Player not found.");
if (PlayerInfo[target_id][pAdmin] >= 1) return SCM(playerid, COLOR_RED, "You are not allowed to kick admins.");
format(kick_string, 200, "%s [%i] has been kicked by %s [%i] due to %s", ReturnName(target_id), target_id, ReturnName(playerid), playerid);
SendClientMessageToAll(COLOR_RED, kick_string);
format(kick_string, 200, "You have been kicked from TWDZS. The Admin who kicked you is: %s", ReturnName(playerid));
SendClientMessage(target_id, COLOR_RED, kick_string);
SendClientMessage(target_id, COLOR_ORANGE, "If you think this kick is unfair complain at www.domain.net");
Kick(target_id);
return 1;
}
This should work, but I didn't test it.