PHP Code:
dosomething_result_async(result)
{
//level notify("stop_async");
entity = clientNumToEntity( int(result[0]));
if(result[1]=="OK"){
entity iprintln("OK");
}
else{
entity iprintln("ERROR"+ result[1]);
}
}
clientNumToEntity(num)
{
players = getentarray("player", "classname");
for (i = 0; i < players.size; i++)
{
if (players[i] getEntityNumber() == num)
return players[i];
}
return undefined;
}
You should call check_async() on gametype start, not on some event, it should always be running.
Notify stops all running threads with the corresponding endon.
And you REALLY should't use exec to to that kind of stuff, mysql/sqlite should be used for that and they can also be called directly on entities.