Raised This Month: $ Target: $400
 0% 

Adding admin level to functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Energie
BANNED
Join Date: Jul 2005
Old 02-26-2006 , 14:11   Adding admin level to functions
Reply With Quote #1

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.
Energie is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-26-2006 , 14:14  
Reply With Quote #2

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 }
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
Energie
BANNED
Join Date: Jul 2005
Old 02-26-2006 , 14:20  
Reply With Quote #3

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.
Energie is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-26-2006 , 14:22  
Reply With Quote #4

you add that code into your script to add admin level control...
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
Energie
BANNED
Join Date: Jul 2005
Old 02-26-2006 , 14:23  
Reply With Quote #5

no i want to use it without user input.
Energie is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-26-2006 , 14:25  
Reply With Quote #6

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?
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
Energie
BANNED
Join Date: Jul 2005
Old 02-26-2006 , 14:28  
Reply With Quote #7

the plugin monitors the users on certain actions (example name changes) , so input goes automaticly.
Energie is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-26-2006 , 14:43  
Reply With Quote #8

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

you can use
get_user_flags
or
is_user_admin
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
Energie
BANNED
Join Date: Jul 2005
Old 02-26-2006 , 14:50  
Reply With Quote #9

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 ?
Energie is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-26-2006 , 15:25  
Reply With Quote #10

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 }
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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