Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[C++] How to make a bodyguard motorcade?


++tachyon
 Share

Recommended Posts

Hello guys,

 

I am trying to make a script that when you are in a vehicle and you spawn a bodyguard the bodyguard will spawn in an fbi2 and follow you around in a motorcade style.

Right now I have successfully spawned the bodyguard and the vehicle, and I have managed to spawn the bodyguard in the drives position. The problem is that since I am in another vehicle the bodyguard will exit the fbi2 and enter my vehicle. How can I prevent this? And how can I make the bodyguard follow me with the fbi2 and follow each other like a motorcade?

 

I spawn the bodyguard peds with this: http://gtaforums.com/topic/793962-bodyguards/

I manage to get the bodyguard inside the fbi2 with this:

AI::TASK_ENTER_VEHICLE();

Thank you for your help will be much appreciated!

Link to comment
Share on other sites

Hello guys,

 

I am trying to make a script that when you are in a vehicle and you spawn a bodyguard the bodyguard will spawn in an fbi2 and follow you around in a motorcade style.

Right now I have successfully spawned the bodyguard and the vehicle, and I have managed to spawn the bodyguard in the drives position. The problem is that since I am in another vehicle the bodyguard will exit the fbi2 and enter my vehicle. How can I prevent this? And how can I make the bodyguard follow me with the fbi2 and follow each other like a motorcade?

 

I spawn the bodyguard peds with this: http://gtaforums.com/topic/793962-bodyguards/

I manage to get the bodyguard inside the fbi2 with this:

AI::TASK_ENTER_VEHICLE();

Thank you for your help will be much appreciated!

Maybe use this native?

(Im not sure about this but its worth a try :D)

TASK_FOLLOW_TO_OFFSET_OF_ENTITY(Ped ped, Entity entity, float p2, float p3, float p4, float p5, Any p6, float p7, BOOL p8) { invoke<Void>(0x304AE42E357B8C7E, ped, entity, p2, p3, p4, p5, p6, p7, p8); } // 0x304AE42E357B8C7E 0x2DF5A6AC
Link to comment
Share on other sites

I've actually been looking into something like this, I tried a while ago to do it but i didn't quite have it all figured out. Hopefully you get this working because a motorcade would be pretty cool :)

Link to comment
Share on other sites

Prof_Farnsworth

Depending how much control you want over them, there are a couple ways to do this. FOLLOW_VEHICLE should work, as well as ESCORT_VEHICLE, although my experience with the escort is that it is not as tight as I would like (I may not have all the params correct) it works for the mod I use it in. Otherwise you can take a look at my armoured car mod linked in my sig. It has custom follow code which allows you to control everything (I have bikes driving beside cars in the same lane) but it is very longwinded and cumbersome.

 

Hope it helps.

Link to comment
Share on other sites

Depending how much control you want over them, there are a couple ways to do this. FOLLOW_VEHICLE should work, as well as ESCORT_VEHICLE, although my experience with the escort is that it is not as tight as I would like (I may not have all the params correct) it works for the mod I use it in. Otherwise you can take a look at my armoured car mod linked in my sig. It has custom follow code which allows you to control everything (I have bikes driving beside cars in the same lane) but it is very longwinded and cumbersome.

 

Hope it helps.

 

Thanks for the tip!

I am also trying with _TASK_VEHICLE_FOLLOW.

When the bodyguards enter the vehicle they lose all group relationships and if I attack them they will attack me back. I also want them to exit their vehicles when I exit mine and follow me on foot.

I'll start experimenting with ESCORT_VEHICLE.

Link to comment
Share on other sites

Prof_Farnsworth

 

Depending how much control you want over them, there are a couple ways to do this. FOLLOW_VEHICLE should work, as well as ESCORT_VEHICLE, although my experience with the escort is that it is not as tight as I would like (I may not have all the params correct) it works for the mod I use it in. Otherwise you can take a look at my armoured car mod linked in my sig. It has custom follow code which allows you to control everything (I have bikes driving beside cars in the same lane) but it is very longwinded and cumbersome.

 

Hope it helps.

 

Thanks for the tip!

I am also trying with _TASK_VEHICLE_FOLLOW.

When the bodyguards enter the vehicle they lose all group relationships and if I attack them they will attack me back. I also want them to exit their vehicles when I exit mine and follow me on foot.

I'll start experimenting with ESCORT_VEHICLE.

 

Them losing their relationship group is very odd, I haven't seen that before. You can have a look at my assassination mod as that has bodyguards in it who leave their vehicle when you do. I'll try to find and post the relevant code later.

Link to comment
Share on other sites

 

 

Depending how much control you want over them, there are a couple ways to do this. FOLLOW_VEHICLE should work, as well as ESCORT_VEHICLE, although my experience with the escort is that it is not as tight as I would like (I may not have all the params correct) it works for the mod I use it in. Otherwise you can take a look at my armoured car mod linked in my sig. It has custom follow code which allows you to control everything (I have bikes driving beside cars in the same lane) but it is very longwinded and cumbersome.

 

Hope it helps.

 

Thanks for the tip!

I am also trying with _TASK_VEHICLE_FOLLOW.

When the bodyguards enter the vehicle they lose all group relationships and if I attack them they will attack me back. I also want them to exit their vehicles when I exit mine and follow me on foot.

I'll start experimenting with ESCORT_VEHICLE.

 

Them losing their relationship group is very odd, I haven't seen that before. You can have a look at my assassination mod as that has bodyguards in it who leave their vehicle when you do. I'll try to find and post the relevant code later.

 

 

 

Many thanks for all your help!

Link to comment
Share on other sites

Prof_Farnsworth

No worries. One thing I did for my bodyguards was set them to not be damaged by my relationship group, that way you cannot attack them. If you try to fire when your crosshair is over them, it won't let you.

 

If I may ask how are you making them bodyguards, simply adding them to your relationship group?

Link to comment
Share on other sites

No worries. One thing I did for my bodyguards was set them to not be damaged by my relationship group, that way you cannot attack them. If you try to fire when your crosshair is over them, it won't let you.

 

If I may ask how are you making them bodyguards, simply adding them to your relationship group?

 

 

I spawn the bodyguards with the following code: http://gtaforums.com/topic/793962-bodyguards/

I only use SET_PED_AS_GROUP_MEMBER for adding him to the group. I have tried with ADD_RELATIONSHIP_GROUP but I don't seem to get the parameters just right.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.