Help with admin levels
#1

Ok so my server is almost ready to go but the last thong Im up to is adding admin levels.

And then make certain levels do certain commands.

Note: I know how it works but I don't no how to start the levels like do I need to download something

so if you could plz help me or if you could even give me a site or something where it will teach you thx
Reply
#2

It's just a variable e.g:

Код:
new admin[MAX_PLAYERS];
Код:
if(admin[playerid] == 0) return 0;
{
// Rest of admin code
}
Reply
#3

So if I wanted a level2 admin to use this command

Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
}
SetPlayerArmour(playerid,100);
{
return 1;
if u could put in so admins level 2 can use this command that would. Help we alot

Thx
Reply
#4

Now i don't use strcmp myself, but i give it a try.

Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(admin[playerid] != 2) return 0;
{
SetPlayerArmour(playerid,100);
}
}
return 1;
Reply
#5

Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(admin[playerid] >= 2)
{
SetPlayerArmour(playerid,100);
}else{return 0;}
}
return 1;
- Try this as this will allow people over level 2 to use the command also.
if admin level is less then 2 it will return as an unknown cmd
Good luck
Reply
#6

Thx alot all done but how do I make it stop at level7 do I just leave it the same as >=2 and it will stop at 7 if that's my highest level
Reply
#7

Doesn't need to stop, you won't get bugs
Reply
#8

Like mentioned it wont bugg ur server, but anyway here's how:

Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(admin[playerid] >= 2 && admin[playerid] <= 7)
{
SetPlayerArmour(playerid,100);
}else{return 0;}
}
return 1;
the only differnce then would be if somone is lvl 8 admin.. then it would said unknown cmd.
Reply
#9

ok thx very much

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)