hello help plz
#1

Actually i want to use these three options isplayeradmin, pAdmin, pHelper but its not working can you help me.
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pHelper] >= 2 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this command!");
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pHelper] < 2 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this command!");
You needed to reverse the check, you were checking if pAdmin & pHelper were above or equal to 2 and saying they couldn't use the command, you should use the code above as it checks if they're below 2 and won't let them use the command if they are.
Reply
#3

no its not still working i am not logged in as rcon admin i am pAdmin = 3 and pHelper = 0 . here is my full code, its keep saying "You are not allowed to use this command!");
pawn Код:
CMD:nmute(playerid, params[])
{
  new pid;
  //if(!IsPlayerAdmin(playerid)) return 1;
  if(PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pHelper] < 2 || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this command!");
  if(sscanf(params,"u",pid)) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /mute [playerid]");
  new name[MAX_PLAYER_NAME],string[128];
  GetPlayerName(pid,name,sizeof(name));
  format(string,sizeof(string),"%s has been muted",name);
  SendClientMessageToAll(COLOR_TOMATO,string);
  PlayerInfo[pid][pNMuted]= 1;
  return 1;
}
Reply
#4

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this command!");
Reply
#5

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this command!");
Sorry, forgot the && signs, that's the working code.
Reply
#6

Thanks both of you but still my one command not working can you tell me whats wrong with it its keep saying not authorized
pawn Код:
CMD:nooc(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 2 && !IsPlayerAdmin(playerid))
    {
        if(OOCSTAT)
        {
            OOCSTAT = 0;
            SendClientMessageToAll(COLOR_LIGHTBLUE, "OOC Chat has been enabled by an Admin.");
        }
        else
        {
            OOCSTAT = 1;
            SendClientMessageToAll(COLOR_LIGHTBLUE, "OOC Chat has been disabled by an Admin.");
        }
    }
    else return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command.");
    return 1;
}
Reply
#7

pawn Код:
CMD:nooc(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command.");
    if(OOCSTAT == 1)//You may take a look at this line
    {
        OOCSTAT = 0;
        SendClientMessageToAll(COLOR_LIGHTBLUE, "OOC Chat has been enabled by an Admin.");
    }
    else
    {
        OOCSTAT = 1;
        SendClientMessageToAll(COLOR_LIGHTBLUE, "OOC Chat has been disabled by an Admin.");
    }
    return 1;
}
Reply
#8

thanks..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)