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.

Looping condition and group spawnpoint

Featured Replies

Hey everybody,

Just getting started here, so please show me some mercy 😊 My goal is to spawn multiple suspects the moment player goes near the callout location.

My first question is is it possible to set a group spawnpoint instead of separate positions for each ped?

 

        public override bool OnBeforeCalloutDisplayed()
        {
            SpawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(150f));
            Spawn2 = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(147f));
            Spawn3 = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(144f));
        }

 

Secondly, how do you loop checking if the condition was met.

 

If  (Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 100f)

 

I wanted to start the fireworks the moment player comes closer than 100 feet but nothing happens (because the code verifies if the condition is met only once). Is there a way to loop it?

Thank you for your time and patience 😊 Cheers.

 

Edited by PawelSad12

  • Author

Hey MisterPaul! Here's a simple example of how to loop the condition:

 

1) This is part of the beginning where you have to define PlayTheActionOnlyOnce():

    public class TerrorHouse : Callout
              {
               private bool

               PlayTheActionOnlyOnce = false;

2) And as we cut to action...

        public override void Process()
        {
            base.Process();

            if (Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 100f)
            //if (the condition)
            {
                // YOUR ACTION
                PlayTheActionOnlyOnce = true;
            }

              if (PlayTheActionOnlyOnce)
              {
                  End();
              } 
        }
    }
}

Seems simple but it took me a day to figure it out, so may be useful for newbies 🙂

Edited by PawelSad12

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.