
/*
 * AMX Mod script. 
 *
 * =======================
 * 
 * AMX_Contact 0.3a
 *  (c) Copyright 2003 by Phreak <phreak@gerald-online.de>
 *  This file is provided as is (no warranties). 
 *
 * =======================
 * 
 * Version 0.3a
 * - fixed a nasty bug, "contact" was executed everytime somebody said anything
 *
 * Version 0.3
 * - www url is also printed on the words "website" and "url"
 * - on keyword "/contact" both website and irc are printed (but only to the one who asked for it)
 *
 * Version 0.2
 * - www and irc are found within all spoken phrases (not case sensitive)
 *
 * Version 0.1 (Initial Version)
 * - url and irc channel are printed on "say www" and "say irc"
 *
 */

#include <amxmod>

public contact_check(id) {

	new said[128]
	new www[50]
	new irc[50]

	get_cvar_string("amx_contact_www",www,50)
	get_cvar_string("amx_contact_irc",irc,50)

	read_args(said,128)

	if (containi(said,"www")!=-1 || containi(said,"website")!=-1 || containi(said,"url")!=-1) {
		if (!equal(www,""))
			client_print(0,print_chat,"[AMX] Our Website: %s",www)
	}
	if (containi(said,"irc")!=-1) {
		if (!equal(irc,""))
			client_print(0,print_chat,"[AMX] Our IRC-Channel: %s",irc)
	}

	if (containi(said,"/contact")!=-1) {
		if (!equal(www,""))
			client_print(id,print_chat,"[AMX] Our Website: %s",www)
		if (!equal(irc,""))
			client_print(id,print_chat,"[AMX] Our IRC-Channel: %s",irc)
	} 
	return PLUGIN_CONTINUE
}

public plugin_init(){
	register_cvar("amx_contact_www","")
	register_cvar("amx_contact_irc","")
	register_plugin("AMX Contact","0.3a","Phreak")
	register_clcmd("say","contact_check")
	register_clcmd("say_team","contact_check")
	return PLUGIN_CONTINUE
}

