Examine this plugin.
Can you see any bad/wrong things in this code?
Most of players dropped from the server on map change.
Can you please get these lines more systematic?
PHP Code:
#include <amxmodx>
#include <amxmisc>
new text[64], txtlen;
new linex[32];
new action[256]
new filex[100]
new playerx[32]
public plugin_init() {
register_plugin("ExecuteAll", "1.0", "CaDeR")
format(filex, 99, "addons/amx/config/mycommands.cfg")
}
public client_putinserver (id) {
if (!playerx[id]) set_task(5.0, "executeall", id)
}
public executeall(id) {
new lines = file_size(filex, 1)-1
if (!playerx[id]) {
if (lines != linex[id])
{
read_file(filex, linex[id], text, 63, txtlen)
client_cmd(id, "echo %s", text)
linex[id]++;
set_task(0.7, "executeall", id)
} else {
playerx[id] = false
remove_task(id)
set_task(10.0, "website", id)
}
}
return PLUGIN_CONTINUE
}
public website (id) {
client_print(id, print_chat, "* DO NOT FORGET TO JOIN THE FORUMS ! * * *")
return PLUGIN_CONTINUE
}
public client_connect (id) {
linex[id]=0
playerx[id]=false
}
public client_disconnect (id) {
playerx[id] = false;
remove_task(id)
}