/*
 * Copyright (C) 2003 Jay Jacobson
 * This is mostly a copy and paste, then modify, of the 
 * original plugin_bot.sma by Alfred Reynolds with specific 
 * commands for JOEBOT added. This plugin only covers JOEBOT.
 * plugin_joebot.sma
*/
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <plugin>
#include <adminlib>
 
// This value is the access level which admins must have in order to 
// access these commands. Change it to something else if you wish.
#define ACCESS_BOT 1024
 
new STRING_VERSION[MAX_DATA_LENGTH] = "beta 2.50.0";
 
public admin_addbot(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new Text[MAX_TEXT_LENGTH];
	new User[MAX_NAME_LENGTH];
 
	convert_string(HLCommand,Command,MAX_NAME_LENGTH);
	convert_string(HLData,Data,MAX_NAME_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	if (access(ACCESS_BOT,"") == 1) {
		snprintf(Text,MAX_TEXT_LENGTH,"joebot addbot");
		exec(Text);
		plugin_message("Per your request, one of JOE's bots has been added");
	}
	return PLUGIN_HANDLED;
}
 
public admin_endround(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot endround");
		plugin_message("The nightmare/boredom ends... *yawn*");
	}
	return PLUGIN_HANDLED;
}
 
public admin_kickbots(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot kickbots|all");
		plugin_message("You aren't very popular with the bots, they are leaving.");
	}
	return PLUGIN_HANDLED;
}
 
public admin_botshooton(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot botshoot|on");
		plugin_message("Consider yourself... ONE OF THE HUNTED!");
	}
	return PLUGIN_HANDLED;
}
 
public admin_botshootoff(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot botshoot|off");
		plugin_message("The bots have decided to not kill... FOR NOW!");
	}
	return PLUGIN_HANDLED;
}
 
public admin_addbotct(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot addbot|2|2");
		plugin_message("Tipping in favor of the Counter-Terrorists are you?");
	}
	return PLUGIN_HANDLED;
}
 
public admin_addbott(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot addbot|1|2");
		plugin_message("Feeling sorry for the Terrorists are you?");
	}
	return PLUGIN_HANDLED;
}
 
public admin_kickbotct(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot kickbot|2|2");
		plugin_message("CT kicked.... he wasn't needed anyway");
	}
	return PLUGIN_HANDLED;
}
 
public admin_kickbott(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot kickbot|1|2");
		plugin_message("Terrorist kicked.... one less Terrorist scum on this server");
	}
	return PLUGIN_HANDLED;
}
 
public admin_fillserver(HLCommand,HLData,HLUserName,UserIndex) {	
	if (access(ACCESS_BOT,"") == 1) {
		exec("joebot fillserver|all|full");
		plugin_message("Most of the players are now better then you.");
	}
	return PLUGIN_HANDLED;
}
 
 
 
public plugin_init() {
	plugin_registerinfo("JoeBot Plugin","Plugin to log users commands.",STRING_VERSION);
	plugin_registercmd("admin_addbot","admin_addbot",ACCESS_BOT,"admin_addbot: Adds a bot. Parameters are as normal for the Bot");
	plugin_registercmd("admin_endround","admin_endround",ACCESS_BOT,"admin_endround: End the bot round.");
	plugin_registercmd("admin_kickbots","admin_kickbots",ACCESS_BOT,"admin_kickbots: Kick all Bots.");
	plugin_registercmd("admin_botshooton","admin_botshooton",ACCESS_BOT,"admin_botshooton: Turn on bot shoot.");
	plugin_registercmd("admin_botshootoff","admin_botshootoff",ACCESS_BOT,"admin_botshootoff: Turn off bot shoot.");
	plugin_registercmd("admin_addbotct","admin_addbotct",ACCESS_BOT,"admin_addbotct: Add a Counter Terrorist Bot.");
	plugin_registercmd("admin_addbott","admin_addbott",ACCESS_BOT,"admin_addbott: Add a Terrorist Bot.");
	plugin_registercmd("admin_kickbotct","admin_kickbotct",ACCESS_BOT,"admin_kickbotct: Kick a Counter Terrorist Bots.");
	plugin_registercmd("admin_kickbott","admin_kickbott",ACCESS_BOT,"admin_kickbott: Kick a Terrorist Bots.");
	plugin_registercmd("admin_fillserver","admin_fillserver",ACCESS_BOT,"admin_fillserver: Fill the server with Bots.");
	return PLUGIN_CONTINUE;
}