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.

Making Ped(cop) aim while taking cover

Featured Replies

I'm making a bank robbery callout where the player is SWAT and has to go in and rescue the hostage, and obviously, in a situation like this, the first police officers there aren't SWAT, but would still be aiming at the bank door in case the robbers come out guns blazing. I've tried a couple functions and haven't found one that gets them to aim at the door properly. I've used TakeCoverFrom() for sure, to no avail. Maybe my timeout duration is too short(set at 100 seconds. I think it's pointless to have a duration anyways) but by the time I get there, they aren't aiming at anything, they're just standing there. I'm tempted to try AimWeaponAt() but I still don't like the duration thing, and the duration might not even be my problem.

 

Second question, related enough to be covered under this topic, I also try to make the officers open their driver door first, and only 2/3 of them do it. Here's the code for both these tasks:

 

Quote

                Officer1.Tasks.EnterVehicle(Sheriff1, -1, EnterVehicleFlags.DoNotEnter).WaitForCompletion(5000);
                Officer2.Tasks.EnterVehicle(Sheriff2, -1, EnterVehicleFlags.DoNotEnter).WaitForCompletion(5000);
                Officer3.Tasks.EnterVehicle(Sheriff3, -1, EnterVehicleFlags.DoNotEnter).WaitForCompletion(5000);

                Officer1.Tasks.TakeCoverFrom(BankDoor, 100000, false);
                Officer2.Tasks.TakeCoverFrom(BankDoor, 100000, false);
                Officer3.Tasks.TakeCoverFrom(BankDoor, 100000, false);

 

Edited by zloganrox08
Put code in quote

1. unlimited duration = -1

2. you could just open the doors with vehicle.Doors[doorIndex].Open(bool p1, bool p2);

3. make sure you are running a new fiber when using something like wait for completion

Edited by NoNameSet

  • Author

Thanks for the replies,

 

The behavior I've noticed when doing wait for completion without a game fiber is that the rest of the game runs, but my code waits until the person finishes the task. I like this because then I can give 2 tasks at the same time (like the above) and not worry about the first one not getting done.

2 hours ago, zloganrox08 said:

Thanks for the replies,

 

The behavior I've noticed when doing wait for completion without a game fiber is that the rest of the game runs, but my code waits until the person finishes the task. I like this because then I can give 2 tasks at the same time (like the above) and not worry about the first one not getting done.

don't run wait for completion without a fiber as it sleeps the current fiber which then will be null and won't end good for you or the user.

  • Author
7 hours ago, NoNameSet said:

don't run wait for completion without a fiber as it sleeps the current fiber which then will be null and won't end good for you or the user.

 

I'll add in a fiber, see if it helps anything. Sidenote, I'm  not PLANNING to release these callouts to people, as I use addon vehicles, but good coding practice is a good idea anyways.

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.