Have you tried this?
Code:self setviewpos x , y , z
Ok so I'm setting up custom spawns, I only have 3 at the moment so I could do some testing but players are spawning in random directions which I had a feeling would happen. Is there a way that I can include viewpos to the coordinates? my code is below
Code:terminalspawn() { if(getDvar("mapname") == "mp_terminal") { if(self.team == "allies") { { self.spawnLocations = []; self.spawnLocations[0] = (-310.8, 4853.7, 253.1); self.spawnLocations[1] = (-56.7, 4866.4, 253.1); self.spawnLocations[2] = (-57.3, 5383.9, 253.1); self setOrigin(self.spawnLocations[randomInt(self.spawnLocations.size)]); } } else if(self.team == "axis") { { self.spawnLocations = []; self.spawnLocations[0] = ( 2254.7, 4485.5, 252.1); self.spawnLocations[1] = ( 1944.4, 5035.9, 252.1); self.spawnLocations[2] = ( 2307.0, 4731.8, 252.1); self setOrigin(self.spawnLocations[randomInt(self.spawnLocations.size)]); } } } }
Have you tried this?
Code:self setviewpos x , y , z
What do you mean? Can you give me an example of this?
x/z are where you are on the map I know that, and y is altitude but all of this is implemented in the code that I pasted in the original post. What I want to do is set a direction for the "player" to be facing when he spawns at on of the particular spawn points that I have created.
Last edited by ijwgamer; 12-14-2013 at 06:57 PM.
This is the code that I want implemented with the spawns, so that it doesn't spawn the player facing a wall or random direction.
Those are for where the player spawns on the map, the number outside of the parentheses to the right of them, is the direction the player faces, and I know it has something to do with self.PlayerAngles or something but I can't figure out how to incorporate this into the code, considering the code randomizes (SpawnLocations)