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.

Combat Peds problem [Callout]

Featured Replies

Hey,

 

You can use:

public Task FireWeaponAt(
	Entity target,
	int duration,
	FiringPattern firingPattern
)

And if you want the ped to get closer you can use:

public Task GoToWhileAiming(
	Entity entity,
	Entity entityToAimAt,
	float distanceThreshold,
	float speed,
	bool fireWeapon,
	FiringPattern firingPattern
)

This will make sure that the ped keeps shoothing (or not depending on what you tell him to do)

 

 

Could you try this?

 

Tell me how it went.

 

Greeting juan.

Thank you

So, depending an what you want you have multiple options:

 

Option 1: Make your suspect fire at a ped, then check if your ped has died if that returns true; make him shoot at you.

 

Option 2: Make your suspect fire at a ped, then when it has died make your suspect fire randomly at all hated peds (or all peds, your choice).

public static Ped[] GetAllPeds();

Use a foreach, and then use an if statments to set a max distance to your ped, check if your ped hate each other, check if any ped is shooting.

 

On the second thing, make sure it is not on a loop, for instance process() is on a loop so if you were to put that code in there without making sure it is only runned once, it wil just keep doing that every iteration. If that is not the case could you provide some code?

 

Greetings juan

Thank you

16 hours ago, gdanbo said:

Hey, thank you so much! The first thing works, for the second thing, yes, I put it there, I'm not really an expert and I don't really know how to make it run only once

Bool HasItRan = False;

void Process(){
  if(!HasItRan){
    //runcode
  }
}

 

Thank you

13 hours ago, epicmrjuan said:

Bool HasItRan = False;

void Process(){
  if(!HasItRan){
    //runcode
  }
}

 

dont think thats be best solution as it still runs for more than a tick so you should switch instead.

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.