Setting viewpos with custom spawns?

Posts 1–8 of 8 · Page 1 of 1
Setting viewpos with custom spawns?
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
Quote Originally Posted by Lovroman View Post
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.
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.

Quote Originally Posted by ijwgamer View Post
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.
Change x , y , z with values that you want.
Quote Originally Posted by Lovroman View Post


Change x , y , z with values that you want.
What about the direction that the player faces?
Quote Originally Posted by ijwgamer View Post
What about the direction that the player faces?

Load a mod(^) that shows player's viewpos, go to the spawn position, read values that mod shows and then paste them in your code.
Quote Originally Posted by Lovroman View Post

Load a mod(^) that shows player's viewpos, go to the spawn position, read values that mod shows and then paste them in your code.
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)
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us