Raised This Month: $51 Target: $400
 12% 

Solved Limit Spectactors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BakSuZ
New Member
Join Date: Nov 2017
Old 11-13-2017 , 11:26   Limit Spectactors
Reply With Quote #1

Hi, i need a Plugin where i can Limit the Spectators on my CS 1.6 Server and if its possible i want an Plugin where only my Admins are allowed to join Spectators.

Thanks in advance.

Last edited by BakSuZ; 11-13-2017 at 22:51.
BakSuZ is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-13-2017 , 12:32   Re: Limit Spectactors
Reply With Quote #2

Code:
/* *   _______     _      _  __          __ *  | _____/    | |    | | \ \   __   / / *  | |         | |    | |  | | /  \ | | *  | |         | |____| |  | |/ __ \| | *  | |   ___   | ______ |  |   /  \   | *  | |  |_  |  | |    | |  |  /    \  | *  | |    | |  | |    | |  | |      | | *  | |____| |  | |    | |  | |      | | *  |_______/   |_|    |_|  \_/      \_/ * * * *  Last Edited: 12-30-07 * *  ============ *   Changelog: *  ============ * *  v2.1 *    -Fixed Bug * *  v2.0 *    -Added ML *    -Optimized Code * *  v1.0 *    -Initial Release * */ #define VERSION "2.1" #include <amxmodx> #include <amxmisc> #include <cstrike> new pcvar public plugin_init() {     register_plugin("Only Admin Spectators",VERSION,"GHW_Chronic")     pcvar = register_cvar("spec_admin","a")     register_dictionary("GHW_Admin_Spec.txt") } public client_putinserver(id) {     set_task(2.0,"check_team",id,"",0,"b") } public check_team(id) {     static adminflags[32]     get_pcvar_string(pcvar,adminflags,31)     if(!is_user_connected(id))     {         remove_task(id)     }     else if(!(get_user_flags(id) & read_flags(adminflags)) && cs_get_user_team(id)==CS_TEAM_SPECTATOR)     {         client_print(id,print_center,"[AMXX] %L",id,"MSG_NOSPEC")         new num, players[32], Float:ct         get_players(players,num,"g")         for(new i=0;i<num;i++)         {             if(players[i]!=id && cs_get_user_team(players[i])==CS_TEAM_CT) ct += 1.0         }         if(float(num) / 2.0 >= ct) cs_set_user_team(id,CS_TEAM_CT)         else cs_set_user_team(id,CS_TEAM_T)     } }

You can also try this, both codes are untested though. The one above is approved so should be working imo.

Code:
#include <amxmodx> #define PLUGIN "Team join info" #define VERSION "1.0" #define AUTHOR "AMXX Community" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event( "TeamInfo", "join_team", "a") } public join_team() {        new id = read_data(1)     static user_team[32]         read_data(2, user_team, 31)            if(!is_user_connected(id) || !(get_user_flags(id) & ADMIN_KICK))         return PLUGIN_HANDLED            switch(user_team[0])     {         case 'C':          {             // player join to ct's                }                 case 'T':         {             // player join to terrorist         }                         case 'S':          {             client_cmd(id, "chooseteam")             client_print(id, print_chat, "[AMXx] Only admins can join spectator.")             return PLUGIN_HANDLED         }                     }     return PLUGIN_HANDLED     }
__________________

Last edited by Napoleon_be; 11-13-2017 at 12:47.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-13-2017 , 19:42   Re: Limit Spectactors
Reply With Quote #3

Code:
allow_spectators 0
Add that to the server.cfg. The Spectators option will not be available to anyone.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 11-13-2017 , 19:45   Re: Limit Spectactors
Reply With Quote #4

Quote:
Originally Posted by wickedd View Post
Code:
allow_spectators 0
Add that to the server.cfg. The Spectators option will not be available to anyone.
He asks, only admins can
Alber9091 is offline
BakSuZ
New Member
Join Date: Nov 2017
Old 11-13-2017 , 22:50   Re: Limit Spectactors
Reply With Quote #5

Thank You very much, that is what i needed.
BakSuZ 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 17:18.


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