Results 1 to 8 of 8
  1. #1
    ijwgamer's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Long Island, New York
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Confused

    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)]);
    			}
    		}
    	}
    }

  2. #2
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,711
    My Mood
    Cheerful
    Have you tried this?
    Code:
    self setviewpos x , y , z

  3. #3
    ijwgamer's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Long Island, New York
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Confused
    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.
    Last edited by ijwgamer; 12-14-2013 at 07:57 PM.

  4. #4
    ijwgamer's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Long Island, New York
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Confused
    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.

    Attached Thumbnails Attached Thumbnails
    s19a.png  


  5. #5
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,711
    My Mood
    Cheerful
    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.

  6. #6
    ijwgamer's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Long Island, New York
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Confused
    Quote Originally Posted by Lovroman View Post


    Change x , y , z with values that you want.
    What about the direction that the player faces?

  7. #7
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,711
    My Mood
    Cheerful
    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.

  8. #8
    ijwgamer's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Long Island, New York
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Confused
    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)

Similar Threads

  1. [Solved] Help with custom spawns
    By oktane in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 5
    Last Post: 07-18-2011, 03:04 PM
  2. [Solved] Help with custom spawns
    By apache-wd-forum in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 15
    Last Post: 06-25-2011, 01:56 PM
  3. Problem with custom spawns
    By prisma in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 6
    Last Post: 10-11-2010, 11:35 AM
  4. [Request]Ak-47 to Ak-103 with custom skin
    By halo2fan120 in forum Combat Arms Mod Request
    Replies: 3
    Last Post: 06-04-2010, 10:33 AM
  5. [RELEASE] L96A1 to L115A2 with Custom Textures
    By InCognito in forum Combat Arms Mods & Rez Modding
    Replies: 11
    Last Post: 04-11-2010, 04:39 PM