/*
 * Admin mod script. Copyright (C) 2000, Alfred Reynolds.
 *
*/
 
/* 
 * This is a lazy mans addon for AdminMod. 
 * It allows both short console commands and says to do admin 
 * commands.
 * 
 * If you want to use the bury/unbury you will need my 
 * plugin_dio_cs.sma   
 *
 * Revisions:
 * 2.50.0 - Created plugin to do SOME lazy commands.
 * 2.50.1 - Added a few commands based on ZellaX's modifications in forums.
 * 2.50.2 - Updated plugin to use new (AM 2.50e) plugin_exec.
 * 2.50.3 - Added Missing strstripquotes() in HandleSay.
*/
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
 
new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.3";
 
public do_lazy(HLCommand,HLData,HLUserName,UserIndex) {
 
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
 
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
 
	snprintf(Command, MAX_DATA_LENGTH, "admin_%s", Command);
	plugin_exec(Command, Data);
 
	return PLUGIN_HANDLED;
}	
 
public HandleSay(HLCommand,HLData,HLUserName,UserIndex) {
 
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
 
	/* Ignore the console */
	if (UserIndex < 1) 
		return PLUGIN_CONTINUE;
 
	//convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	strstripquotes(Data);
 
	if (strmatch(Data, "csay ", 5)==1  ||
		strmatch(Data, "psay ", 5)==1    ||
		strmatch(Data, "chat ", 5)==1    ||
		strmatch(Data, "slap ", 5)==1    ||
		strmatch(Data, "slay ", 5)==1    ||
		strmatch(Data, "bury ", 5)==1    ||
		strmatch(Data, "unbury ", 7)==1  ||
		strmatch(Data, "llama ", 6)==1   ||	
		strmatch(Data, "unllama ", 8)==1 ||	
		strmatch(Data, "gag ", 4)==1     ||	
		strmatch(Data, "ungag ", 6)==1 ) 
	{
 
		strbreak(Data, Command, Data, MAX_TEXT_LENGTH);
 
		snprintf(Command, MAX_DATA_LENGTH, "admin_%s", Command);
		plugin_exec( Command, Data);	
		return PLUGIN_HANDLED;
	}
 
	return PLUGIN_CONTINUE;
}
 
public plugin_init() {
	plugin_registerinfo("Dio's Lazy Plugin","Admin Mod commands for the lazy Admin.",STRING_VERSION);
 
	plugin_registercmd("csay","do_lazy",ACCESS_ALL,"csay : see admin_csay.");
	plugin_registercmd("psay","do_lazy",ACCESS_ALL,"psay : see admin_psay.");
	plugin_registercmd("chat","do_lazy",ACCESS_ALL,"chat : see admin_chat.");
	plugin_registercmd("slap","do_lazy",ACCESS_ALL,"slap : see admin_slap.");
	plugin_registercmd("slay","do_lazy",ACCESS_ALL,"slay : see admin_slay.");
	plugin_registercmd("bury","do_lazy",ACCESS_ALL,"bury : see admin_bury.");
	plugin_registercmd("unbury","do_lazy",ACCESS_ALL,"unbury : see admin_unbury.");
	plugin_registercmd("llama","do_lazy",ACCESS_ALL,"llama : see admin_llama.");		
	plugin_registercmd("unllama","do_lazy",ACCESS_ALL,"unllama : see admin_unllama.");	
	plugin_registercmd("gag","do_lazy",ACCESS_ALL,"gag : see admin_gag.");
	plugin_registercmd("ungag","do_lazy",ACCESS_ALL,"ungag : see admin_ungag.");
 
	plugin_registercmd("say","HandleSay",ACCESS_ALL);
	plugin_registercmd("team_say","HandleSay",ACCESS_ALL);
 
	return PLUGIN_CONTINUE;
}