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.

[SOLVED] Can't Manipulate Ped after Invoking Animation

Featured Replies

Goal:  Make ped flee when player is within X distance of the ped (before pursuit initiates).

Problem:  When I am within 50m of the ped, the animation stops but nothing else happens.  The ped becomes static.  They don't even flee when the pursuit initiates unless I knock them over.  I've spent a majority of the day troubleshooting and trying different solutions (including using natives, clearing ped tasks, and changing BlockPermanentEvents to false).  I would appreciate some guidance.

Edit:  It turns out that when I am within 50m the animation will stop and the ped is static, but when I leave the 50m area the ped will then flee.

Solution Edit:  I was able to fix my problem by creating a boolean for Fleeing and incorporating it into my if statement, similar to how the pursuit is managed.  I will leave this post here in case someone has a similar issue in the future.

 

OnCalloutAccepted()

if ((SpawnChance >= 5 && SpawnChance <= 9) && rand <= 50)
{
  Game.LogTrivial("Spawning Dealer ped outside of buyer vehicle");
  Dealer = new Ped("csb_ballasog", BuyerVehicle.GetOffsetPosition(new Vector3(1f, 0f, 0f)), BuyerVehicle.Heading + 90f);
  Dealer.RandomizeVariation(); // Random clothing
  Dealer.IsPersistent = true;
  Dealer.BlockPermanentEvents = true;
  Dealer.Tasks.PlayAnimation("amb@prop_human_bum_shopping_cart@male@idle_a", "idle_b", 1, AnimationFlags.Loop);
}

Process()

if (Game.LocalPlayer.Character.DistanceTo(Dealer.Position) < 50f)
{
  // Make dealer flee when player is within 50m

  //Game.DisplayHelp("Player within distance");
  Dealer.Tasks.Flee(Game.LocalPlayer.Character, 100, -1);
}

Process() fixed

if (!Fleeing && Game.LocalPlayer.Character.DistanceTo(Dealer.Position) < 50f)
{
  // Make dealer flee when player is within 50m

  //Game.DisplayHelp("Player within distance");
  Dealer.Tasks.Flee(Game.LocalPlayer.Character, 100, -1);
  Fleeing = true;
}

 

Edited by Rich

Released plugins

Rich's Police EnhancementsScene Manager | Rich Ambiance

Retired?

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.