Need Seriously Help
#3

Add that at the begging of the script:
#define COLOR_ADMIN 0xFF0066FF
#define COLOR_RED 0xFF0000AA

Working Command:

Код:
CMD:unban(playerid,params[])
{
        if(pInfo[playerid][Adminlevel] < 4)return SendClientMessage(playerid,COLOR_RED,"[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command.");
        new targetid, string[128];//R = Reason
  new Query[500];

        if(sscanf(params, "u", targetid))
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Usage:{FFFFFF} /unban [ID] [Reason]");
            return 1;
        }
  if(pInfo[playerid][Adminlevel] ==3 )
  {
      SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command.");
      return 1;
  }
        if(pInfo[playerid][Adminlevel] >= 4 || IsPlayerAdmin(playerid))
  {
                pInfo[targetid][Banned] = 0;

                format(Query, sizeof(Query), "UPDATE users SET banned = %d WHERE username = '%s'",
            pInfo[targetid][Banned],
            targetid);
          db_query(DatabaseAcc, Query);

  format(string, sizeof(string), "[UN-BANNED] You have unbanned %s", targetid);
  SendClientMessage(playerid, COLOR_ADMIN, string);

     }
  return 1;
}
Reply


Messages In This Thread
Need Seriously Help - by VillainPRO - 25.12.2013, 18:08
Re: Need Seriously Help - by FahadKing07 - 25.12.2013, 18:20
Re: Need Seriously Help - by SplinteX - 25.12.2013, 18:28
Re: Need Seriously Help - by VillainPRO - 25.12.2013, 19:02
Re: Need Seriously Help - by FahadKing07 - 25.12.2013, 19:26

Forum Jump:


Users browsing this thread: 1 Guest(s)