/* A simple plugin to turn alltalk on or off - created by sWa | Castr0 */
 
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
 
 
#define ACCESS_ALLTALK 32
 
new STRING_VERSION[MAX_DATA_LENGTH] = "2.51.00";
 
public admin_alltalk(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new alltalk;
 
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
    	convert_string(HLData,Data,MAX_DATA_LENGTH);
    	convert_string(HLUserName,User,MAX_NAME_LENGTH);
    	alltalk = getvar("sv_alltalk");
    	if(alltalk == 1) {
        	execute_command(User,Command,"sv_alltalk","0");
    		centersay("AllTalk Is Now Disabled",18,249,244,0);
	} else {
       		execute_command(User,Command,"Sv_alltalk","1");
		centersay("AllTalk Is Now Enabled",18,249,244,0);
	}
 
 
	return PLUGIN_HANDLED;
}
 
public plugin_init() {
	plugin_registerinfo("Counter-Strike Common Comands","Common commands specific to the Counterstrike mod.",STRING_VERSION);
 
	plugin_registercmd("admin_alltalk","admin_alltalk",ACCESS_ALLTALK,"admin_alltalk: Toggles AllTalk on and off.");
 
 
	return PLUGIN_CONTINUE;
}