ItsMods

Full Version: Spawn on predefined points problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi its me again, i know i know sorry .
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.
Are you sure you added this code after "waittill( "spawned_player" );" in the OnPlayerSpawned function?

Uploading your whole code might help
(09-29-2012, 20:55)iAegle Wrote: [ -> ]Are you sure you added this code after "waittill( "spawned_player" );" in the OnPlayerSpawned function?

Uploading your whole code might help

i did it a bit difference. thank you so much, now it works Smile
all my mods started from 2nd round now everything gonna be ok Smile