AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Only Admin Spectators (https://forums.alliedmods.net/showthread.php?t=46723)

GHW_Chronic 11-01-2006 02:48

Only Admin Spectators
 
10 Attachment(s)
  • 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"

aligind4h0us3 11-01-2006 03:10

Re: Only Admin Spectators
 
Interesting. What if people want to demo a hacker or something?

GHW_Chronic 11-01-2006 03:47

Re: Only Admin Spectators
 
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.

Venny 11-03-2006 11:19

Re: Only Admin Spectators
 
Works good, was looking for this =]

Brad 11-09-2006 10:22

Re: Only Admin Spectators
 
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")     } }

Mordekay 11-09-2006 11:31

Re: Only Admin Spectators
 
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.

GHW_Chronic 11-09-2006 12:27

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

Mordekay 11-09-2006 12:29

Re: Only Admin Spectators
 
:D
That sounds like "karma up" when it is done ;)

Brad 11-09-2006 12:53

Re: Only Admin Spectators
 
Yes, this works with AMXBans too.

aligind4h0us3 11-10-2006 00:59

Re: Only Admin Spectators
 
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


All times are GMT -4. The time now is 22:27.

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