hi, i want to start some thread after player spawn again to mp game, when he was killd before;
because this thread need targetname $player to work ;
how can i do it?
start thread after spawn of player
Moderator: Moderators
I think I know what you are asking. Here is what I think:
That starts the thread after the player died. If you want to wait until they spawn then try this:
This is 100% untested so that is up to you. Post again if you need any more help. Hope this helps.

Code: Select all
while(1)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if(isAlive $player[local.i])
{
//do nothing
}
else
{
thread my_thread
}
}
end
Code: Select all
while(1)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if(isAlive $player[local.i])
{
$player[local.i].dead = 0
}
else
{
$player[local.i].dead = 1
thread my_thread
}
}
end
my_thread:
waittill isAlive $player[local.i]
//Put what you want to do here.
end
