25.05.2013, 10:13
Here is my command:
pawn Код:
CMD:kick(playerid, params)
{
new targetid;
new reason[70];
new string[200];
if(gPlayerInfo[playerid][pAdminLevel] < gCommands[KICK])return SCM(playerid, COLOR_RED, "[ERROR]: You can't use this command!");
if(sscanf(params, "us[70]", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /kick [playerid] [reason]");
if(IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
if(gPlayerInfo[playerid][pAdminLevel] == gPlayerInfo[targetid][pAdminLevel]) return SCM(playerid, COLOR_YELLOW, "[WARNING]: You can't Kick an Admin with a same Level then you!");
if(gPlayerInfo[playerid][pAdminLevel] < gPlayerInfo[targetid][pAdminLevel]) return SCM(playerid, COLOR_YELLOW, "[WARNING]: You can't Kick an Higher Admin then you!");
format(string, sizeof(string), "[Kick]: %s has Kicked %s from the Server!||Reason: %s", GetName(playerid), GetName(targetid), reason);
SCMToAll(COLOR_YELLOW, string);
Kick(targetid);
return 1;
}