Should look like this? Or should include, depending? I think it's so pretty ... or at least, I do not give any erroare, I did not test him.
One question, if well, one must put the text in another? I do not want to read everything, but line by line ...
Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("Auto-Messages", "1.0", "Team")
set_task(7.5, "Hud", _, _, _, "b")
set_task(15.0, "Chat", _, _, _, "b")
}
public func()
{
new path[128], fh, cache[128]
get_configsdir(path, 127)
format(path, 127, "%s%s", path, "/messages.ini")
if(!file_exists(path))
{
log_amx("Error: file does not exist (%s).", path)
return
}
fh = fopen(path, "rt")
if(!fh)
{
log_amx("Error: Could not open file (%s).", path)
return
}
new example_counter
while(!feof(fh))
{
fgets(fh, cache, 127)
example_counter++
log_amx("loaded line number %d: %s", example_counter, cache)
}
fclose(fh)
}
public Chat(id)
{
client_print(0, print_chat, "%s", "path")
}
public Hud(id)
{
set_hudmessage(random(255), random(255), random(255), -1.0, 0.08, random_num(0, 2), 0.02, 6.0, 0.01, 0.1, 2)
show_hudmessage(0, "%s", "path")
}