Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Spawning Peds at target location using Coordinates

Featured Replies

Hello all, i am having troubles finding the information i need through google searches and looking through open source code.

 

I am trying to spawn a ped at a certain location on the map for a callout i have the x,y,z and heading but cannot seem to work out how to spawn the ped at the location.

There were some forum posts talking about a SpawnPoint method but i cannot for the life of me work out how to access it if it exists or how to make one.

 

Does anyone have any idea on how to do this using C# as it will be fundermental in my callouts when setting up scenes ect.

 

Thank you for any and all information, even suggestions on what to search for will be very useful. Cheers

Officer Dog, Sye Dog.

Hey,

 

when you spawn a ped you can use:

public Ped(
	Vector3 position,
	float heading
)

Example:

Ped p = new Ped(new vector3(1,1,1),7) //This will spawn a ped at 1,1,1 and with a heading of 7

When you have already spawned it and want to change it's location use: Ped.Posistion

 

I hope this helps! let me know if there is anything else i can do!

 

Used pages:

Rage docs, ped constructor

Thank you

  • Author
12 minutes ago, epicmrjuan said:

Hey,

 

when you spawn a ped you can use:


public Ped(
	Vector3 position,
	float heading
)

Example:


Ped p = new Ped(new vector3(1,1,1),7) //This will spawn a ped at 1,1,1 and with a heading of 7

When you have already spawned it and want to change it's location use: Ped.Posistion

 

I hope this helps! let me know if there is anything else i can do!

 

Used pages:

Rage docs, ped constructor

 

Thanks for that!

 

So if i was wanting a variable of SpawnPoint to be used later i could use

private Vector3 SpawnPoint;

Ped Suspect = new Ped(new Vector3(1, 1, 1), 7); //spawning a new ped called Suspect at 1,1,1 with heading 7
            SpawnPoint = Suspect.Position; //Setting the spawnpoint location to the position of spawned ped

Correct or totally wrong?

Officer Dog, Sye Dog.

2 minutes ago, Syedogg said:

 

Thanks for that!

 

So if i was wanting a variable of SpawnPoint to be used later i could use


private Vector3 SpawnPoint;

Ped Suspect = new Ped(new Vector3(1, 1, 1), 7); //spawning a new ped called Suspect at 1,1,1 with heading 7
            SpawnPoint = Suspect.Position; //Setting the spawnpoint location to the position of spawned ped

Correct or totally wrong?

Uhmm,

 

do this when you want to spawn it at your posistion,

use the code you wrote when you want to change a posistion from a spawned ped.

 

You clould store the vector and heading together by using a struct.

Vector3 spawnpoint = new vector3(541,5461,215);
Ped p = new Ped(spawnpoint, 8);

Bye!

Thank you

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.