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.

KidnappedPed Flees Vehicle

Featured Replies

I was wondering if there was a way to stop my kidnappedPed from fleeing the car before i press "Y", Everything works fine until the kidnapperPed gets out of the car and shoots me, and once i shoot back, The kidnappedPed leaves the vehicle before i can press "Y"

Heres my code:

Spoiler

if (!takerPed.Exists() && !takerPed.IsInAnyVehicle(false) && Vector3.Distance(player.Position, kidnappedPed.Position) <= 10.0f || !Functions.IsPedGettingArrested(takerPed) || !Functions.IsPedArrested(takerPed))
            {

                Game.DisplayHelp("To Release Victim, Press: ~b~Y");

                if (Game.IsKeyDown(Keys.Y))
                {
                    kidnappedPed.Tasks.LeaveVehicle(LeaveVehicleFlags.LeaveDoorOpen).WaitForCompletion();
                    kidnappedPed.Tasks.Wander().WaitForCompletion(10000);
                    this.End();
                }
            }

Everthing looks right to me, but i dont know why the gosh darn ped keeps leaving the vehicle before i press "Y" :sad:

HOOYAAA

12 hours ago, TitanSloth said:

I was wondering if there was a way to stop my kidnappedPed from fleeing the car before i press "Y", Everything works fine until the kidnapperPed gets out of the car and shoots me, and once i shoot back, The kidnappedPed leaves the vehicle before i can press "Y"

Heres my code:

  Reveal hidden contents

if (!takerPed.Exists() && !takerPed.IsInAnyVehicle(false) && Vector3.Distance(player.Position, kidnappedPed.Position) <= 10.0f || !Functions.IsPedGettingArrested(takerPed) || !Functions.IsPedArrested(takerPed))
            {

                Game.DisplayHelp("To Release Victim, Press: ~b~Y");

                if (Game.IsKeyDown(Keys.Y))
                {
                    kidnappedPed.Tasks.LeaveVehicle(LeaveVehicleFlags.LeaveDoorOpen).WaitForCompletion();
                    kidnappedPed.Tasks.Wander().WaitForCompletion(10000);
                    this.End();
                }
            }

Everthing looks right to me, but i dont know why the gosh darn ped keeps leaving the vehicle before i press "Y" :sad:

Looks fine here...Have you set the BlockedPermanentEvents to true?

My YouTube: Click here. 

My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU

Useful post? Let me and others know by clicking the Like button.
Check out my many script modifications! 
Having issues? LSPDFR Troubleshooter by Albo1125.

  • Author
9 hours ago, Albo1125 said:

Looks fine here...Have you set the BlockedPermanentEvents to true?

yes, and still nothing :(

 

HOOYAAA

Maybe this?

while (true)
{
if (Game.IsKeyDown(Keys.Y))
                {
                    kidnappedPed.Tasks.LeaveVehicle(LeaveVehicleFlags.LeaveDoorOpen).WaitForCompletion();
                    kidnappedPed.Tasks.Wander().WaitForCompletion(10000);
                    this.End();
                }
  GameFiber.Yield();
}

I am not certain it'll fix your problem, but  your key won't be registered in the first place, because your if statement won't be true. So, you must place an infinite loop to keep checking that if statement until the player hits the Y key (which makes the if statement true).

Edited by tanu1215

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.