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.

How to make ped shoot out of van

Featured Replies

I was wondering how I could make a ped shoot out of a van.

I have the following in mind: I want to create a pursuite where, if the player is close enough to the van, the back doors whould open and two peds should shoot at the player.

I've got the logic for the pursuit and the doors opening when the player gets close, but I can't figure out how to make the peds shoot out of the van.

Here's the code:

Ped creation:

shooter1 = new Ped(spawnPoint);
shooter1.IsPersistent = true;
shooter1.BlockPermanentEvents = true;
shooter1.Inventory.GiveNewWeapon(WeaponHash.MicroSMG, 400, true);
shooter1.WarpIntoVehicle(van, 1);

shooter2 = new Ped(spawnPoint);
shooter2.IsPersistent = true;
shooter2.BlockPermanentEvents = true;
shooter2.Inventory.GiveNewWeapon(WeaponHash.Pistol, 400, true);
shooter2.WarpIntoVehicle(van, 2);

 

Shooting logic: 

shooter1.RelationshipGroup = RelationshipGroup.HatesPlayer;
shooter2.RelationshipGroup = RelationshipGroup.HatesPlayer;

shooter1.Inventory.EquippedWeapon = shooter1.Inventory.Weapons[0];
shooter2.Inventory.EquippedWeapon = shooter2.Inventory.Weapons[0];

shooter1.Tasks.FightAgainst(playerPed);
shooter2.Tasks.FightAgainst(playerPed);

van.Doors[2].Open(false);
van.Doors[3].Open(false);

 

So far, once the player gets close, everything works except the peds shooting. They instead just keep calmly sitting in the back of the van even closing the doors again after they were opened.

 

Please help ❤️

Edited by LouiDev

  • Author

Yes.
Forgot I still had this post.
For anyone wondering. Adding the ped to a pursuit overrides their Tasks completly. 

But you can disable that through 

Functions.SetPursuitDisableAIForPed(pursuit, ped)

 

Didn't know that

  • 6 months later...

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.