Made som smaller changes to (and as you can see stripped the code to not have all the functions of the original script.
Code:
public irc_saytext(id)
{
if (irc_socket > 0)
{
new msg[1024]
read_args(msg,1024)
if(!get_cvar_num("irc_from_hlds_say_auto"))
{
new activator[26]
get_cvar_string("irc_from_hlds_say_activator",activator,25)
if(containi(msg,activator) == -1)
return 0
else
replace(msg,1024,activator,"")
}
new tmsg[1024]
get_cvar_string("irc_msg_srvsay",tmsg,1024)
if (strlen(msg) <= 2)
return PLUGIN_HANDLED
parsemessage(id,tmsg,temp,msg)
format(temp,1024,"PRIVMSG %s :%s^r^n",chan,temp) //Yes, I know I shouldnt do that
additem(temp)
return PLUGIN_HANDLED
}
return 0
}
public irc_sayteamtext(id)
{
if (irc_socket > 0)
{
new msg[1024]
read_args(msg,1024)
if(!get_cvar_num("irc_from_hlds_say_auto"))
{
new activator[26]
get_cvar_string("irc_from_hlds_say_activator",activator,25)
if(containi(msg,activator) == -1)
return 0
else
replace(msg,1024,activator,"")
}
new tmsg[1024]
get_cvar_string("irc_msg_srvteamsay",tmsg,1024)
if (strlen(msg) <= 2)
return PLUGIN_HANDLED
parsemessage(id,tmsg,temp,msg)
format(temp,1024,"PRIVMSG %s :%s^r^n",chan,temp) //Yes, I know I shouldnt do that
additem(temp)
return PLUGIN_HANDLED
}
return 0
}
These functions now check that there's actually a message behin the "activator" !needamin, and I changed return 0 to return PLUGIN_HANDLED so that the !needadmin message is hidden from the users on the servers.
Dont want our cheaters to leave the servers before we get our demo and ban them
Thanks for the original code, without this I would be lost. I wouldnt even know where to look for scrripting resources.
But what I would like to do later on, Is making a script that connects to an eggdrop-bot and parses the info trough there, so that I can have one bot on irc that forwards the messages from all servers.
I'm a tech-admin at csplanet.no and currently maintaining 4 public servers and a warserver (hopefully 3 more warservers soon), and I'm constantly looking for ways to enhance our players gaming experience
If anyone has a way to either make these bots stay online (not reconnecting all the time), or to make them connect with an eggdrop-bot, please do tell