Jump to content

[Solved]How to make a random callout location?


Faya

Recommended Posts

I need my callout to be at a random location, just like any other callout. How do i do that?

(It currently spawns in front of me)

 

What i currently use:

SpawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(250f));

 

 

Do i have to use alot of different coordinates or is there a feature for minimum callout range in the reference.

My last resort is going around the map collecting coordinates.

 

I manage to do everything succesfull besides this haha

 

Edited by Faya

🇳🇱

Link to comment
Share on other sites

  • The title was changed to How to make a random callout location?
  • Management Team

It really depends on what you want and need. You can collect coordinates and use them randomly, or based on distance to the player if you want predefined locations. If you can make with generic locations, you can also just get random points around the player (use the Around function with different random values). 

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

Link to comment
Share on other sites

  • The title was changed to [Solved]How to make a random callout location?

I sorta answered this in your other support topic. The .Around function needs a minimum and maximum distance for what you're trying to do. This will find a spot on a road within these ranges. If it's spawning too close then raise 190 to a higher number. If it's too far away then lower 500 to a lower number. It's also a good idea to add a little while loop with a count timer so your code never hangs while trying to find a position.

 

World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(190, 500)); // (closest position to player, furthest position to player)

 

 

lspdfrsig.png.9270aca86574b7a164a861f72ccd502d.png

Find all of my LEGACY projects (GTA: SA) plus more in-depth support of current projects on my modding index.

(ONLY my personal work is available and supported on the index)

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...