10.03.2010, 21:09
Im making a kick command,
If you have some dislikes about the command dont say it :P
I was wondering how to make it for RCON admins aswell as the admin level?
Id prefer it in the format im using if you could
If you have some dislikes about the command dont say it :P
I was wondering how to make it for RCON admins aswell as the admin level?
Id prefer it in the format im using if you could
pawn Код:
CMD:kick(playerid, params[])
{
new id, reason;
if (AccountInfo[playerid][AdminLevel] < 0) SendClientMessage(playerid, COLOR_RED, "Error ~ You are not an administrator with the required level");
else if (sscanf(params, "uz", id, reason)) SendClientMessage(playerid, COLOR_RED, "Usage ~ /kick [PlayerID/PartOfName] [Reason]");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "Error ~ Player not Connected");
else if (AccountInfo[id][AdminLevel] > 5) SendClientMessage(playerid, COLOR_RED, "Error ~ You cannot kick the highest level admin");
else
{
new string[128];
new sendername[MAX_PLAYER_NAME];
new targetname[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof sendername);
GetPlayerName(playerid, targetname, sizeof targetname);
format(string, sizeof string, "Administrator %s has kicked you from the server, Reason: %s", sendername, reason);
SendClientMessage(id, COLOR_BLUE, string);
format(string, sizeof string, "You have kicked player %s, Reason: %s", targetname, reason);
SendClientMessage(playerid, COLOR_BLUE, string);
Kick(playerid);
}
return 1;
}