I have a couple questions about the async methods.
I tried to implement them as best as I could, an example
PHP Code:
dosomething_async(killer , killd)
{
exec_async_create("./save.sh " + killer + " " + killd, ::dosomething_result_async);
check_async();
}
dosomething_result_async(result)
{
level notify("stop_async");
entity = GetEntByNum( int(result[0]));
if(result[1]=="OK"){
entity iprintln("OK");
}
else{
entity iprintln("ERROR"+ result[1]);
}
}
check_async()
{
level endon("stop_async");
for(;;)
{
wait 0.05;
exec_async_checkdone();
}
}
killed(eInflictor, eAttacker)
{
killer = eAttacker GetEntityNumber();
killd = self GetEntityNumber();
if(killd!=killer)
{
dosomething_async(killer , killd);
}
}
i get error
PHP Code:
******* script compile error *******
return value of developer command can not be accessed if not in a /# ... #/ comment: (file 'maps/mp/gametypes/_kill.gsc', line 10)
entity = GetEntByNum(int(result[0]));
do you have any ideas?
My goal is to iprintln on client only after correctly using save.sh
Second question if two events are launched (kill events in this case) and then the first one terminates and notifies "stop_async" do both check_async terminates? or only the first one?