admin command only
#1

hi how to make a admin only command?
Reply
#2

Check if the player is an admin. (RCON)

EX:
pawn Код:
if(IsPlayerAdmin(playerid) == 1))
{
   //code here
}
Reply
#3

pawn Код:
if(IsPlayerAdmin(playerid) == 1))
{
  //do something here
  return 1;
}else{
  SendClientMessage(playerid, COLOR_RED, "You are not an admin");
  return 0;
  }
  return 1;
}
hope taht helps..
Reply
#4

Quote:
Originally Posted by ·٠•●°Alive°●•٠·
pawn Код:
if(IsPlayerAdmin(playerid) == 1))
{
  //do something here
  return 1;
}else{
  SendClientMessage(playerid, COLOR_RED, "You are not an admin");
  return 0;
  }
  return 1;
}
hope taht helps..
at this:

pawn Код:
if(IsPlayerAdmin(playerid) == 1))
is that only for admins that are lvl 1?

can i change it to
pawn Код:
if(IsPlayerAdmin(playerid) == 5))
only command for lvl 5 admins?
Reply
#5

No,it works only if you have logged in as an RCON admin.

If you want an admin system,download one.

the
Код:
== 1))
will only check if you ARE an admin and
Код:
== 0))
will check if you're not an admin
Reply
#6

You can also add a value and save it to files like...
pawn Код:
new pAdminLevel[MAX_PLAYERS];
and it can be used to define the level. OFC you must save/load it each time a player connects/disconnects/updates/logins/logsout/wherever you need it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)