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.

Give a ped a specific model

Featured Replies

  • Author

And do you now how to spawn a ped or car behind the suspect

somthing like this but than working

Cop = new Ped("s_m_y_cop_01", SpawnPoint + 12f, 90f);

i found it myself

Cop = new Ped("s_m_y_cop_01", (Suspect.GetOffsetPosition(new Vector3(0, 5f, 0))), 180f);

 

Edited by epicmrjuan

Thank you

I'd like to add in a few things here just so you can look back on this when you are further into coding and want to know this and that about spawning Ped's/Vehicle's so you don't have to start a new topic later on, as the answer will be right here :)

First, you have your simple spawning of your Ped.

//myCopPed1 is the name of the ped you will use throughout your code, I used myCopPed1 as 1) it's a cop, 2) I have another cop Ped which is named myCopPed2.

//= new Ped creates the Ped, and then you can sift through the arrow keys up and down to find (Model model, SpawnPoint spawnpoint, float heading);

// under Model model you can put whatever model ID you want, so in my case I want a police officer, so I did "s_m_y_cop_01".

// I have set my SpawnPoint as SpawnPointmyCopPed1.Position, yours could be called just plain SpawnPoint, but mine is from a more complex callout.

// and then, I believe (never used it), float heading is ho high or low the ped is. Generally you would want your Ped at 0.0f unless you have some weird callout that spawns the guy in the air lol (Suicidal Guy Jumped off Building? CALLOUT IDEA! :) )

myCopPed1 = new Ped("s_m_y_cop_01", SpawnPointmyCopPed1.Position, 0.0f);

Now, you may be wondering later on.. can I list off a few different models and just get it to randomly pick from that list/string of models? Yes, you can! It's pretty simple too..

// Okay, in this example I'm using a Vehicle style, same thing as Ped but spawning a Vehicle.

// We use Model[] VehicleModels = new Model[] to start off and initialise it, and then we do { }; and inside those brackets we list off in strings what models we want spawned. So since I want a cop car, I could put any cop car models in there, which I have done.

Model[] VehicleModels = new Model[]
            {
                "POLICE", "POLICE2", "POLICE3", "POLICE4", "FBI"
            };

// Here, we're just doing the same thing we did for our CopPed. we do myCopCar1 to start it off, = new Vehicle to tell the code we're creating a new Vehicle, then (VehicleModels[new Random().Next(VehicleModels.Length)] okay that might sound confusing, but it's just taking the VehicleModels we created, creating a new Random generator type of sorts, and creating the next vehicle to spawn, except randomly. Then we have SpawnPointmyCopCar1.Position to tell it where to spawn the car, again, yours could be as simple as "SpawnPoint".

myCopCar1 = new Vehicle(VehicleModels[new Random().Next(VehicleModels.Length)], SpawnPointmyCopCar1.Position);

Hope this helped or helps you in the future, if you need any further explaining or have some questions let me know! I'm always here :)

Edited by ToastinYou

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.