This should do what you've asked:
PHP Code:
#include <amxmodx>
new bool:g_AllowLoto[33];
public plugin_init()
{
register_plugin("Stuff", "1.0", "vL.");
}
public client_putinserver(id)
{
set_task(600.0, "AllowLoto", id);
}
public AllowLoto(id)
{
g_AllowLoto[id] = true;
}
public client_disconnect(id)
{
g_AllowLoto[id] = false;
remove_task(id);
}
public the_loto_thing(id)
{
if(!g_AllowLoto[id])
return PLUGIN_HANDLED;
// your code
g_AllowLoto[id] = false;
set_task(600.0, "AllowLoto", id);
return PLUGIN_CONTINUE;
}
It's a bit redundant how you did it. The task set in plugin_init will not do anything because you don't have an id to use in plugin_init. And why do you need to know when the player spawns? Maybe I'm missing something.