Raised This Month: $32 Target: $400
 8% 

Only Admin Spectators


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   Brad (55)
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 11-01-2006 , 02:48   Only Admin Spectators
Reply With Quote #1

  • That one kid told me his clan leader was afraid of ghosters in spec mode but still wanted admins to be able to go into spec mode. So this plugin does just that. If an admin has the right flag, set by CVAR, he can join the spec team. Anyone else will be forced onto the least-populated team upon attempting to join the spec team.


CVAR:
  • spec_admin - cvar sets what flag (from users.ini) that the admin needs to join spec.
    • any number of flags allowed (example: "abcd")
    • Default: "a"
Attached Files
File Type: sma Get Plugin or Get Source (GHW_Admin_Spec.sma - 12606 views - 1.5 KB)
File Type: txt GHW_Admin_Spec.txt (359 Bytes, 6886 views)

Last edited by GHW_Chronic; 04-15-2008 at 17:41.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
aligind4h0us3
Senior Member
Join Date: Sep 2006
Location: Sydney, Australia
Old 11-01-2006 , 03:10   Re: Only Admin Spectators
Reply With Quote #2

Interesting. What if people want to demo a hacker or something?
__________________
~+Karma if I help you.~
aligind4h0us3 is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 11-01-2006 , 03:47   Re: Only Admin Spectators
Reply With Quote #3

then they can't unless they die and spec. if you allow people to do that and that is your concern and you have no other plugin to deal with reporting hackers, then dont use this.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Venny
Member
Join Date: Nov 2006
Old 11-03-2006 , 11:19   Re: Only Admin Spectators
Reply With Quote #4

Works good, was looking for this =]
__________________

Venny is offline
Send a message via AIM to Venny Send a message via Skype™ to Venny
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 11-09-2006 , 10:22   Re: Only Admin Spectators
Reply With Quote #5

Chronic:

Not necessarily a much more efficient way to detect if someone has the appropriate admin flags but it is much cleaner and will allow people using your plugin to specify as many admin flags as they'd like.

Instead of this:
Code:
public team_select(id) {     new flag     new cvarstring[1]     get_pcvar_string(pcvar,cvarstring,1)     switch(cvarstring[0])     {         case 'a': flag = 1         case 'b': flag = 2         case 'c': flag = 4         case 'd': flag = 8         case 'e': flag = 16         case 'f': flag = 32         case 'g': flag = 64         case 'h': flag = 128         case 'i': flag = 256         case 'j': flag = 512         case 'k': flag = 1024         case 'l': flag = 2048         case 'm': flag = 4096         case 'n': flag = 8192         case 'o': flag = 16384         case 'p': flag = 32768         case 'q': flag = 65536         case 'r': flag = 131072         case 's': flag = 262144         case 't': flag = 524288         case 'u': flag = 1048576         case 'y': flag = 16777216         case 'z': flag = 33554432     }     if(get_user_flags(id) & flag)     {         if(task_exists(id)) remove_task(id)     }     else if(!task_exists(id))     {         set_task(2.0,"check_team",id,"",0,"b")     } }

You can do this:
Code:
public team_select(id) {     new adminFlags[32];     get_pcvar_string(pcvar, adminFlags, 31);         if (get_user_flags(id) & read_flags(adminFlags))     {         if(task_exists(id)) remove_task(id)     }     else if(!task_exists(id))     {         set_task(2.0,"check_team",id,"",0,"b")     } }
__________________
Brad is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 11-09-2006 , 11:31   Re: Only Admin Spectators
Reply With Quote #6

Does this work for amx-bans too? I don't have my admins in the users.ini, i manage them via the amx-bans websystem.
__________________

Mordekay is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 11-09-2006 , 12:27   Re: Only Admin Spectators
Reply With Quote #7

@brad: never thought about that. ill add the code when I get home.

Last edited by GHW_Chronic; 11-09-2006 at 17:37.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 11-09-2006 , 12:29   Re: Only Admin Spectators
Reply With Quote #8


That sounds like "karma up" when it is done ;)
__________________

Mordekay is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 11-09-2006 , 12:53   Re: Only Admin Spectators
Reply With Quote #9

Yes, this works with AMXBans too.
__________________
Brad is offline
aligind4h0us3
Senior Member
Join Date: Sep 2006
Location: Sydney, Australia
Old 11-10-2006 , 00:59   Re: Only Admin Spectators
Reply With Quote #10

Brad, maybe you want to approve this as well as it was posted a long time before this and is very ready to be approved:

http://forums.alliedmods.net/showthread.php?t=46338
__________________
~+Karma if I help you.~
aligind4h0us3 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 13:40.


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