
/* AMX Mod script.
*
* (c) Copyright 2002, OLO
* This file is provided as is (no warranties).
*
*/


#include <amxmod> /* natives */

public auto_join(id){
	/* is_user_bot(id) - we don't have to check. amx won't allow to execute
	real commands on bots - use engclient_cmd(id,"menuselect","5") 
	with short delay instead - if you really want to make bots executing that command */
	client_cmd(id,"menuselect 5")
	client_cmd(id,"menuselect 5")
	/* you can't use engclient_cmd without delay because it is faster then some vars in CS are set 
	(just after finishing menu displaying - with last message_end call)
	so your command won't be catched, we must use normal client_cmd
	to allow packages to travel for a while (faster then task, slower than engclient_cmd) */
	return PLUGIN_CONTINUE
}

public plugin_init(){
	register_plugin("AutoTeam Select","0.5","ozz")
	register_event("ShowMenu","auto_join","b","4&Team_Select") /* Team_Select - this is from cstrike/titles.txt */
	register_event("VGUIMenu","auto_join","b","1=2","1=26","1=27")
	/* for VGUI you must check what values under read_data(1) are
	so i have read that when Select Team appears 1st value is 2
	and for Class 1st 26 or 27 (w/o spec. or with spec.)*/
	return PLUGIN_CONTINUE
}

