// plugin_wipeout_autoresponse.sma
// Author: Wiepout
// Code Borrowed from: Luke Sankey
//Thanks to Sank, yensid, Jaguar, and Alfred
// Date April 8, 2001
//
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
 
new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.0";
 
 
public plugin_init() 
{
	plugin_registerinfo("Server Autoresponse Plugin", "Responds to certain chat messages.", STRING_VERSION);
 
	plugin_registercmd("say", "HandleSay", ACCESS_ALL);
 
	return PLUGIN_CONTINUE;
}
 
 
public HandleSay(HLCommand, HLData, HLUserName, UserIndex) 
{
	new Command[MAX_COMMAND_LENGTH];
	new Speech[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new Text[MAX_TEXT_LENGTH];
 
	convert_string(HLCommand, Command, MAX_COMMAND_LENGTH);
	convert_string(HLData, Speech, MAX_DATA_LENGTH);
	convert_string(HLUserName, User, MAX_NAME_LENGTH);
	strstripquotes(Speech);
 
 
 
	if ( (strcasestr(Speech, "friendly fire") != -1) || (strcasestr(Speech, "ff on") != -1) || (strcasestr(Speech, "ff was on") != -1) || (strcasestr(Speech, "ff") != -1) || (strcasestr(Speech, "ff is on") != -1) )
	{
		if (getvar("mp_friendlyfire") == 1)
		{
			say("Friendly fire is ON!  Watch your fire!");
		}
		else
		{
			say("Friendly fire is OFF!  Shoot whomever you wish.");
		}
	}
 
	if ( (strcasestr(Speech, "lag") != -1) ) {
     		say("Oh shure, blame the server");
	} else if ( (strcasestr(Speech, "WTF") != -1) ) {
     		say("You died, stupid.");
	} else if ( (strcasestr(Speech, "bullshit") != -1) ) {
     		say("If you say so.");
		slap(User);
	} else if ( (strcasestr(Speech, "bs") != -1) ) {
     		say("If you say so.");
		slap(User);
	} else if ( (strcasestr(Speech, "b$") != -1) ) {
     		say("If you say so.");
		slap(User);
	} else if ( (strcasestr(Speech, "85") != -1) ) {
     		say("If you say so.");
		slap(User);
	} else if ( (strcasestr(Speech, "bull") != -1) ) {
     		say("If you say so.");
		slap(User);
	} else if ( (strcasestr(Speech, "gay") != -1) ) {
     		say("If you say so.");
		slap(User);
	} else if ( (strcasestr(Speech, "fag") != -1) ) {
     		say("If you say so.");
		slap(User);
	} else if ( (strcasestr(Speech, "god") != -1) ) {
     		say("Speaking.");
	} else if ( (strcasestr(Speech, "admin") != -1) ) {
     		say("The admins are Wipeout and Flush.");
	} else if ( (strcasestr(Speech, "what makes grass grow") != -1) ) {
     		say("Blood, blood, blood!");
	} else if ( (strcasestr(Speech, "i love") != -1) && (strcasestr(Speech, "server") != -1) ) {
		snprintf(Text, MAX_TEXT_LENGTH, "I love you, too, %s.", User);
		say(Text);
	} else if ( (strcasestr(Speech, "/me hugs server") != -1) ) {
		snprintf(Text, MAX_TEXT_LENGTH, "Server hugs %s back.", User);
		say(Text);
	} else if ( (strcasestr(Speech, "this sucks") != -1) ) {
		snprintf(Text, MAX_TEXT_LENGTH, "We can read the score, %s.", User);
		say(Text);
	} else if ( (strcasestr(Speech, "stupid") != -1) ) {
		snprintf(Text, MAX_TEXT_LENGTH, "No, you're stupid, %s.", User);
		say(Text);
	} else if ( (strcasestr(Speech, "hate") != -1) ) {
		snprintf(Text, MAX_TEXT_LENGTH, "Hey! where's the love, %s?", User);
		say(Text);
	} else if ( (strcasestr(Speech, "i like") != -1) && (strcasestr(Speech, "n-sync") != -1) ) {
	{
		if(access(ACCESS_IMMUNITY, User) == 0)
		{
			snprintf(Text, MAX_TEXT_LENGTH, "%s was kicked for bad taste.", User);
			say(Text);
			kick(User);
		}
	}
	}
 
	return PLUGIN_CONTINUE;
}