So I just wrote this and it apparently works.
Code:
#include <amxmodx>
#include <engine>
public plugin_init()
{
register_clcmd("say /test", "OnSayTest");
register_think("player", "OnThink");
}
public OnSayTest(id)
entity_set_float(id, EV_FL_nextthink, get_gametime() + 1.0);
// This gets called 1 second after writing "/test"
public OnThink(id)
client_print(id, print_chat, "* Think.");
However I didn't notice anyone else doing this instead of
Code:
set_task(1.0, "OnSayTest", id);
So I'm wondering if it's safe to hook player's Think? This should be much better than settings tasks for player's individually and we also avoid creating a new entity for hooking its think, if seeking performance over setting tasks.
Of course, there could only be one task per player per all the plugins at a time.