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.

What's a good way to force a callout to spawn at predefined locations?

Featured Replies

Both example callouts provided with LCPDFR spawn peds at any clear spot on the street. However, suppose I want to, say, spawn characters in a nearby bar. I have a list of bar interiors with coordinates for each one. What would I do to get them to properly spawn a) inside and b) randomly chosen from the list, rather than with LCPDFR's "pick spot around" function?

  • Management Team

Presuming your dictionary looks like this: <SpawnPoint, string roomName>, I'd do something like this. Note that I did not test this.

        private static Dictionary<SpawnPoint, string> barPositions = new Dictionary<SpawnPoint, string>()
                                                                         {
                                                                             {
                                                                                 new SpawnPoint(0.0f, Vector3.Zero), "ROOM_STRING"
                                                                             }
                                                                         };
 
            // Get closest bar
            var closestBar = (from element in barPositions.Keys
                           orderby element.Position.DistanceTo2D(LPlayer.LocalPlayer.Ped.Position)
                           select element).First();

            // Get room name
            string roomName = barPositions[closestBar];

            // Spawn ped
            LPed barPed = new LPed(closestBar.Position, CModel.GetRandomModel(EModelFlags.IsPed | EModelFlags.IsCivilian).ModelInfo.Name, LPed.EPedGroup.MissionPed);
            if (barPed.Exists())
            {
                barPed.CurrentRoom = Room.FromString(roomName);
            }

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • 3 months later...

Just wondering has this actually been tested and does it work, and also how can I get it to spawn at a location outside. I'm sorry if this is explained in the API's help file, but I have troubles reading those things, they always seem cryptic lol.

logo.png GMC Founder
Check out our Public Computer Database | Try out my Script's
Members should not be afraid of their community, community's should be afraid of their members.

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.