Well, one thing I noticed is you are Declaring a var inside the for loop Declaration [ie: for( new i = 0; .... ) ], which is okay, unless you use break inside of it, then Small won't like it anymore (i think it fails to deallocate the counters memory or something).. Simple fix, declare your counter var outside the for loop structure..
Also, public plugin_init() function doesn't require a return value.. so PLUGIN_CONTINUE was useless.. anyway, no harm there...
Code:
#include <amxmodx>
new phrase[2][] = { "hello", "hi" }
public say_event( id )
{
new said[192], sid[2], i
read_args(said,191)
sid[0] = id
for( i = 0; i < 2; i++ )
{
if(containi(said,phrase[i]) > -1)
{
set_hudmessage(225, 25, 25, -1.0, 0.32, 0, 2.0, 9.0, 0.8, 0.8, 2)
show_hudmessage(0,"Hello and welcome to this server")
set_task(1.0,"client",0,sid,1)
break
}
}
return PLUGIN_HANDLED
}
public client(sid[])
{
new id = sid[0]
// Using the word 'hello' or 'hi' (from phrase[] above) will cause an infinite loop..
// Think: if the player says hello, you call this function, which makes them say Hello again!
// I changed Hello to Hey..
client_cmd(id,"say ^"Hey! Welcome to This Server!^"")
client_cmd(0, "spk ^"you are a ass hole^"")
}
public plugin_init()
{
register_plugin("Say Hello","0.4","SneakerBoots")
register_clcmd("say","say_event")
}