Jump to content
Sign in to follow this  
aseliot

findEmptyPosition

Recommended Posts

_playerPosition = position cfire findEmptyPosition[3,6];
player setpos _playerPosition;

I try to place a player near a campfire with min distance 3 but sometimes it still spawns on the player somehow (I would expect it to at least spawn 3 meters away from him?) and I die because an animation is played and you to have to wait. How am I supposed to do this.

Share this post


Link to post
Share on other sites

Might just not be a lot of room maybe?  Here's using your code in a random seemingly open location and there was almost no available spots.  Using [3,6] I got no results at all.  

 

In this picture Red is [1,6], Orange is [2,6] and Blue is [3,10]:

 

zkMh3Lw.jpg

Share this post


Link to post
Share on other sites

I would assume the number is in meters? 10 seems to much as I noticed it can spawn in a strange location so I tried to do it as close as possible.

 

EDIT - Well i give up, it just doesn't work as expected. Anyone have an idea of how to spawn a campfire, player (not on campfire) and a tent on a random location.

Share this post


Link to post
Share on other sites

This should do it:
 

player setVehiclePosition [cfire, [], 6, "NONE"]; 
player setDir (player getDir cfire);

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×