AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Adding admin level to functions (https://forums.alliedmods.net/showthread.php?t=24579)

Energie 02-26-2006 14:11

Adding admin level to functions
 
How to add access / admin level control to scripts.

For example you need kick level in order to access an intern function in the script. I dont met amx_test but intern script level control.

c0rdawg 02-26-2006 14:14

http://wiki.amxmodx.org/index.php/In...od_X_Scripting

Quote:

Code:
public cmd_hp(id, level, cid) {      if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED      return PLUGIN_HANDLED }


Energie 02-26-2006 14:20

Quote:

Originally Posted by c0rdawg
http://wiki.amxmodx.org/index.php/Intro_to_AMX_Mod_X_Scripting

Quote:

Code:
public cmd_hp(id, level, cid) {      if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED      return PLUGIN_HANDLED }


thats instructions for the use of amx_COMMAND i think, im not searching for that.

c0rdawg 02-26-2006 14:22

you add that code into your script to add admin level control...

Energie 02-26-2006 14:23

no i want to use it without user input.

c0rdawg 02-26-2006 14:25

without user input? so you want it to run automatically without anyone calling it... and somehow check the level access of someone who didn't call the command?

Energie 02-26-2006 14:28

the plugin monitors the users on certain actions (example name changes) , so input goes automaticly.

c0rdawg 02-26-2006 14:43

so you want to see if users are admins or something?

you can use
get_user_flags
or
is_user_admin

Energie 02-26-2006 14:50

Quote:

Originally Posted by c0rdawg
so you want to see if users are admins or something?

you can use
get_user_flags
or
is_user_admin

How would i use does ?

c0rdawg 02-26-2006 15:25

for is_user_admin you can do something like
Code:
if ( is_user_admin(id)) { // Do what you would do if the user is admin } else { // Do what you would do if the user isn't admin }


All times are GMT -4. The time now is 20:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.