How to make this work for RCON admins
#1

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

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;
}
Reply


Messages In This Thread
How to make this work for RCON admins - by Torran - 10.03.2010, 21:09
Re: How to make this work for RCON admins - by laser50 - 10.03.2010, 21:14
Re: How to make this work for RCON admins - by Carlton - 10.03.2010, 21:15
Re: How to make this work for RCON admins - by Torran - 10.03.2010, 21:17
Re: How to make this work for RCON admins - by Scenario - 10.03.2010, 22:30

Forum Jump:


Users browsing this thread: 1 Guest(s)