Hi. I have a question.
What is a variable life time?
For this case:
PHP Code:
public client_putinserver(plrid)
{
new param[1];
param[0] = plrid;
set_task(30.0, "showInfo", BASE_TASK_ID + plrid, param, 1);
return PLUGIN_CONTINUE;
}
public showInfo(param[])
{
new plrid = param[0];
//....
}
How long this task can be delayed to function to get an alive variable? For me this is working, but I doesn't know can I depend on this or not.
Or this is a bad code practise?
Because here:
http://www.amxmodx.org/funcwiki.php?go=func&id=253
phatency wrote:
PHP Code:
new args[1];
public test1(id)
{
args[0] = id;
set_task(60.0,"MyFunction",0,args,1,"a",5);
}
//args is defined outside function
//because it might get deleted before MyFunction is called,
//if it were defined inside test1.