2 posts,
2 people · 3,271 views
Thread Rating: ★★★★★
| closedSpectator time limit ? |
| Started by TigerMan4 on 03-29-2009, 02:14 AM |
started this thread
Posts: 317Threads: 37
Joined: Aug 2006
03-29-2009, 02:14 AM
#1
Is there a plugin or can someone make a plugin that would limit how long someone can stay in specatate ?rnrnmeaning , like the afk kicker , and boot them after say 5 minutes or 10 minutes ?rnrnwe have been having a problem with admins and clan members sitting in spectate all day long and never joining the game.
posted here
Posts: 776Threads: 75
Joined: Nov 2007
03-29-2009, 01:41 PM
#2
i did test this and made in 8 min, but try it...rnrn*EDIT*rnrnThis works :)rnrn
/* Plugin generated by AMXX-Studio */rn////////////////////////////////////////////////////////////////////////////////////////////////////rn#include <amxmodx>rn#include <dodx>rn////////////////////////////////////////////////////////////////////////////////////////////////////rn#define PLUGIN "kick spectators"rn#define VERSION "1.0"rn#define AUTHOR "Dr.G"rn////////////////////////////////////////////////////////////////////////////////////////////////////rn//#define TASK_ID 6675rn////////////////////////////////////////////////////////////////////////////////////////////////////rnnew p_on, p_timern////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic plugin_init() rn{rn register_plugin(PLUGIN, VERSION, AUTHOR)rn rn /* on | off */rn p_on = register_cvar("dod_ks","1")rn rn /* time before we kick ppl in sec */rn p_time = register_cvar("dod_ks_time","600") /* 60*10 = 10 min ;) */rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic client_putinserver( id )rn{rn if(get_pcvar_num( p_on ) && !is_user_bot( id ))rn set_task( get_pcvar_float( p_time ), "bye_bye", id )rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic dod_client_changeteam( id )rn{rn if(get_pcvar_num( p_on ) && (get_user_team( id ) == 3) && !task_exists( id ) && !is_user_bot( id ))rn {rn set_task(get_pcvar_float(p_time), "bye_bye", id)rn return PLUGIN_CONTINUE rn }rn rn if(get_pcvar_num( p_on ) && ( get_user_team( id ) == 1 || 2 ) && task_exists( id ) && !is_user_bot( id ))rn {rn remove_task( id )rn return PLUGIN_CONTINUE rn }rn return PLUGIN_CONTINUErn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic bye_bye( id )rn{rn new c_name[33]rn get_user_name( id, c_name, sizeof c_name - 1 )rn rn client_print( 0, print_chat, "*** %s was kicked for being spectator too long...", c_name )rn rn new c_userid = get_user_userid( id )rn server_cmd( "kick #%d ", c_userid )rn rn return PLUGIN_CONTINUErn}rn//////////////////////////////////////////////////////////////////////////////////////////////////// rn
