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.

How to make callouts only spawn near to you

Featured Replies

So basically I have a callout in development where all the clothes stores in the whole map have a certain "shoplifting" incident. All these locations have vector 3's and are all logged in my plugin, however I noticed that for a simple call like that, they seem to spawn on the other side of the map, instead of nearby. 

 

I need an efficient way to check the distance to the locations, maybe a for-each loop looking inside an array of the x,y,z coordinates, and returning the distances to each callout in another array, then checking which one is the closest and spawning that one. I dont know how efficient that would be, plus coding it would be rather tedious and annoying.

 

Anyone else have any ideas, maybe from your own callout packs?

Edited by techgamer15

Its beeen a SUPPPER long time since I have made a callout but did you try the Vector3 Method Around2D(Single)? Or maybe the method DistanceTo(Single,Vector3) (when applicable)?


Its been a long time but hopefully that hits somewhere in the ballpark

 

Edited by tHeReALkItKaT

- tHeReALkItKaT

If I'm understanding this correctly all you need is a spawnpoint class then a list of spawnpoints in a list which you order by distance to a vector when called.

  • Author
23 hours ago, tHeReALkItKaT said:

Its beeen a SUPPPER long time since I have made a callout but did you try the Vector3 Method Around2D(Single)? Or maybe the method DistanceTo(Single,Vector3) (when applicable)?


Its been a long time but hopefully that hits somewhere in the ballpark

 

I'll have a look at that when GTA actually works again. Thanks.

What's so hard about it just create a class where you can set a vector3, a heading you can have the area and street name as well, heres an example from my old callout pack:

internal class SpawnHelper
{
    public float Heading;
    public string Area;
    public string Street;
    public Vector3 Location;
    public Rotator Rotation;
    
    public SpawnHelper(Vector3 location, float heading, string area, string street)
    {
        this.Location = location;
        this.Heading = heading;
        this.Area = area;
        this.Street = street;
    }

    public SpawnHelper(Vector3 location, float heading)
    {
        this.Location = location;
        this.Heading = heading;
    }

    public SpawnHelper(Vector3 location, Rotator rotation)
    {
        this.Location = location;
        this.Rotation = rotation;
    }
}

Edited by NoNameSet

On 7/12/2018 at 7:56 PM, NoNameSet said:

What's so hard about it just create a class where you can set a vector3, a heading you can have the area and street name as well, heres an example from my old callout pack:


internal class SpawnHelper
{
    public float Heading;
    public string Area;
    public string Street;
    public Vector3 Location;
    public Rotator Rotation;
    
    public SpawnHelper(Vector3 location, float heading, string area, string street)
    {
        this.Location = location;
        this.Heading = heading;
        this.Area = area;
        this.Street = street;
    }

    public SpawnHelper(Vector3 location, float heading)
    {
        this.Location = location;
        this.Heading = heading;
    }

    public SpawnHelper(Vector3 location, Rotator rotation)
    {
        this.Location = location;
        this.Rotation = rotation;
    }
}

I have this issue too, but I load all my locations from a XML file, how do I make them spawn when you are in a certain range only?

check the distance?

21 minutes ago, NoNameSet said:

check the distance?

What do you mean?

27 minutes ago, NoNameSet said:

check the distance?

            //LOAD A LIST OF SPAWNS FROM A FILE
            ListOfSpawns = Serialization.LoadFromXML<ExtendedSpawnPoint>("FirearmLSTCoords");

            //GET A RANDOM INDEX
            int randIndex = MathHelper.GetRandomInteger(0, ListOfSpawns.Count - 1);

            ExtendedSpawnPoint espSpawn = ListOfSpawns[randIndex];

            //GET A SPAWN FROM THE LIST
            SpawnPoint = ListOfSpawns[randIndex].Position;

 

this is my code, I want the callout only to apear when the player is in a certain range of the spawns

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.