End thread on disconnect *help*
Posted: May 10th, 2011, 12:48 pm
Hello.
I need some help on a script.
When the player disconnects I want all the threads to be stoped and the entities attached to him deleted.
I know I could use the endon("disconnect");
but im trying to find another way
all my threads end on "stop_portal"
and I have this function threaded
Portal_Stop()
{
self common_scripts\utility::waittill_any("death","disconnect","joined_spectators","spawned");
self notify("stop_portal");
}
My Question now is, if the player (self) disconnects, will it still be able to notify self with "stop_portal", or will it be a script error (only on lan, so I cant test for sure)
And also i have another function, which is:
waitfor_Delete_Portals()
{
self waittill("stop_portal");
Delete_portals();
}
In Delete_Portals() it will delete the entities attached to self.
But will it work even if the player disconnected?
Or is there a workaround
I need some help on a script.
When the player disconnects I want all the threads to be stoped and the entities attached to him deleted.
I know I could use the endon("disconnect");
but im trying to find another way
all my threads end on "stop_portal"
and I have this function threaded
Portal_Stop()
{
self common_scripts\utility::waittill_any("death","disconnect","joined_spectators","spawned");
self notify("stop_portal");
}
My Question now is, if the player (self) disconnects, will it still be able to notify self with "stop_portal", or will it be a script error (only on lan, so I cant test for sure)
And also i have another function, which is:
waitfor_Delete_Portals()
{
self waittill("stop_portal");
Delete_portals();
}
In Delete_Portals() it will delete the entities attached to self.
But will it work even if the player disconnected?
Or is there a workaround