Admin Levels
#1

Hello everyone, I was wondering if you guys could help me. I recently created a register / log in system and now i want to make a administrative part of it. So i guess what i am wanting help on would be setting up the levels. ( eg. so like if you have lvl 1 you can kick people and stuff like that ) i dont really need to know how to kick people as much as saving infomation on like what lvl the person is. If you could help i would really appreciate it! Thanks

- Kody
Reply
#2

this sounds quite complicated, i would recoomend looking at some other admin filter scripts and try to make a level field in your account system using dini
Reply
#3

when i created my reg/login system i use dudb... Shool i make a new one? or wut?
Reply
#4

Since you already have the registration part finished, I assume that the players have their own file or a database for player stats. All you really need to do is setup a player variable such as pAdmin, and detect if it has a value greater than 0. This can be loaded and saved whenever you need, but it's best to only save it when needed. By default It would be best to make it 0 on registration. Then as you define admins with an /makeadmin command or whatever, you can add levels.

Код:
if(PlayerInfo[playerid][pAdmin] >= 1) {//kick functions}
^If the player has an admin level greater or equal to 1, execute the kick functions.^

You would put a "if" statement similar to that in your /kick command. You could also use a "switch" statement.

Hope this helps a little.

Stephen
Reply
#5

I use dudb for mine and this is how I do it.

in their user file add AdminLevel=Level
or make a command to do dUserSetINT(PlayerName).("AdminLevel",Level);
and than when you want to check their admin level for things just do something like if(dUserINT(PlayerName).("AdminLevel") >= Level)

If you figured out how to make the reg/login with dudb it shouldn't be too hard for you to do this, good luck!
Reply
#6

Thanks for you help, I will see what i can do. Thanks again!
Reply
#7

1 question how would i get a persons level?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)