Hi its me again, i know i know sorry .
i have some problem with that code:
i added self thread SetupSpawn(); to onjoinedteam and it works fine and spawn me at my own coordinates but only after 1st round (its Search and destroy). First round we allways spawn at the defoult points.
i tryed to ad self thread SetupSpawn(); to init, to onplayerconnect, and to onplayerspawned. nothing changed. on some of them code doesnt works at all on some - its works after 1st round.
any ideas please?
Thank you for attention.
i have some problem with that code:
Code:
SetupSpawn()
{
if(getDvar("mapname") == "mp_favela"){
self thread dofavela();
}
}
dofavela()
{
level.spawn[0] = (-649, 207, 144);
level.spawn[1] = (-726, 340, 144);
level.spawn[2] = (-735, 176, 149);
level.axispawn[0] = (-1051, 2945, 282);
level.axispawn[1] = (-971, 2950, 282);
level.axispawn[2] = (-862, 2648, 288);
level.axispawn[3] = (-963,2612, 281);
level.axispawn[4] = (-1105, 2655, 281);
wait .05;
if(self.team == "allies")
self setOrigin(level.spawn[RandomInt(level.spawn.size)]);
else if(self.team == "axis")
self setOrigin(level.axispawn[RandomInt(level.axispawn.size)]);
}
i added self thread SetupSpawn(); to onjoinedteam and it works fine and spawn me at my own coordinates but only after 1st round (its Search and destroy). First round we allways spawn at the defoult points.
i tryed to ad self thread SetupSpawn(); to init, to onplayerconnect, and to onplayerspawned. nothing changed. on some of them code doesnt works at all on some - its works after 1st round.
any ideas please?
Thank you for attention.