How to make different levels
#1

i want to make different levels for admin.... how can i make it.It is booooooooooooooorrrrrring to do if(IsPlayerAdmin(playerid))

So please someone can help me in it?

I want to make admin system..!!
Reply
#2

Store the adminlevel in an array, then you can refer to it easily.
Reply
#3

Please can you tell me how??

i just need 1 example, because i wanna use in my script
Reply
#4

its like you store level ( PlayerData[playerid][level] , you make a new variable for admin ( [playerid][admin], and at the admins commands check if his [admin] level is big enough.
Reply
#5

new PlayerAdmin[MAX_PLAYERS];

On connect store and load this variable.

Make a 'makeadmin' command then just check the level for using it, ex.:

CMD:makeadmin(blabla) {
blabla

if(PlayerAdmin[playerid] != 3) return SCM(blabla, "You need to be level 3 admin.");

PlayerAdmin[another] = level;

return 1;
}
Reply
#6

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
its like you store level ( PlayerData[playerid][level] , you make a new variable for admin ( [playerid][admin], and at the admins commands check if his [admin] level is big enough.
Is this an example??

i just want an example because i understand everything from an exaple
Reply
#7

Please someone give me an good example , these example doesn't works for me, i didnt did copy/paste
Reply
#8

You can find ""examples"" in the filterscripts thread.
Reply
#9

a simple search would have leaded you to 100+ examples.

https://sampforum.blast.hk/showthread.php?tid=303794
Reply
#10

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
its like you store level ( PlayerData[playerid][level] , you make a new variable for admin ( [playerid][admin], and at the admins commands check if his [admin] level is big enough.
Exactly what this guy said above, you need to store the player enumerator.

PHP код:
enum AdminLevel
{
   
Level
}
new 
PlayerInfo[MAX_PLAYERS][AdminLevel]; 
So once we did a enum for the player, it's now going to be like PlayerInfo[playerid][Level], now let's come to the commands (i will use ZCMD because it's faster, simple and pretty much viable compared to strcmp).

PHP код:
CMD:sethp(playeridparams[])
{
   if(
PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid, -1"{C3C3C3}(INFO) You don't have the priviliges to use this command.");
   {
     new 
amountstr[128], target;
     if(
sscanf(params"ui"targetamount)) return SendClientMessage(playerid, -1"{c3c3c3}(INFO) /sethp [id] [amount]");
     
format(strsizeof(str), "{EFB509}(INFO) An admin has set your health to %d"amount);
     
SendClientMessage(target, -1str);
     
SetPlayerHealth(targetamount);
   return 
1;

That's a simple Admin Command, with this
PHP код:
 if(PlayerInfo[playerid][Level] < 1
you check if the player has enough admin level to run the command.

PS: you should just starting learning about player enumerations, you are like stuck on a simple code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)