Raised This Month: $ Target: $400
 0% 

Automatically Run on Admin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Madness
Member
Join Date: Aug 2005
Old 11-24-2005 , 20:21   Automatically Run on Admin
Reply With Quote #1

I need some help for scripting. How can I make a plugin automatically run on an admin? For example, I have a plugin that makes players have ESP rings. How can I make it so that plugin only runs on the admin so he/she is the only one to see the rings? Since I am not a total noob, I can infer what to do if you can show me plugins that do this. Thanks for any help.
Madness is offline
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-24-2005 , 20:25  
Reply With Quote #2

Code:
public Client_PreThink(id) {     if(access(id,ADMIN_LEVEL_A))     {           //do ur stuff here     } }

note:
you can change "ADMIN_LEVEL_A" to any other admin flag
like ADMIN_KICK.. enjoy.

note2:
the function "Client_PreThink" triggers itself all the time
so u dont need to call it from another function nore the plguin_init function


another option but less flexible:
Code:
public Client_PreThink(id) {     if(is_user_admin(id))     {           //do ur stuff here     } }

good luck
haimmaik is offline
Madness
Member
Join Date: Aug 2005
Old 11-24-2005 , 21:10  
Reply With Quote #3

Sweet. Now I can abuse being admin even more.

As an example: This would make the admin have no footstep sound right?

Code:
public plugin_init() {     register_plugin("admin_madness","1.0","Madness")   } public Client_PreThink(id) {     if(access(id,ADMIN_LEVEL_A))         {         set_user_footsteps(id,1)         } }
Madness is offline
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-25-2005 , 05:09  
Reply With Quote #4

yep thats right
haimmaik is offline
Madness
Member
Join Date: Aug 2005
Old 11-26-2005 , 17:48  
Reply With Quote #5

Code:
public plugin_init() {     register_plugin("admin_madness","1.0","Madness")   } public Client_PreThink(id) {     if(access(id,ADMIN_LEVEL_A))         {         set_user_footsteps(id,1)         } }

It didn't work, and I don't understand why. I have the right level. I also made sure the includes were right.
Madness is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 11-26-2005 , 18:04  
Reply With Quote #6

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("admin_madness","1.0","Madness") } public Client_PreThink(id) {     if((get_user_flags(id) & ADMIN_LEVEL_A) && is_user_alive(id))     {         set_user_footsteps(id,1)     } }


try this.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Janet Jackson
Veteran Member
Join Date: Mar 2005
Location: far, far away from here
Old 11-26-2005 , 22:21  
Reply With Quote #7

I hope I'll never enter your server, Madness.
__________________
Janet Jackson is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-26-2005 , 22:56  
Reply With Quote #8

actually you have written
Code:
set_user_footsteps(id, 1)
so it would enable your footsteps, right?
[ --<-@ ] Black Rose is offline
Madness
Member
Join Date: Aug 2005
Old 11-29-2005 , 19:21  
Reply With Quote #9

Quote:
Originally Posted by Janet Jackson
I hope I'll never enter your server, Madness.
Now why is that?
Madness is offline
Janet Jackson
Veteran Member
Join Date: Mar 2005
Location: far, far away from here
Old 11-29-2005 , 19:27  
Reply With Quote #10

Because you give admins a fundamental advantage in the game. I consider it cheating. Unless of course this is all hypothetical and for educational purposes only.
__________________
Janet Jackson is offline
Reply



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 15:58.


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