Pathfind::getSafeCoordForPed: Difference between revisions
(yay) |
No edit summary |
||
| Line 1: | Line 1: | ||
When onGround == true outPosition is a position located on the nearest pavement.<br><br>When a safe coord could not be found the result of a function is false and outPosition == Vector3.Zero.<br><br>In the scripts these flags are used: 0, 14, 12, 16, 20, 21, 28. 0 is most commonly used, then 16. <br><br>16 works for me, 0 crashed the script. | When onGround == true outPosition is a position located on the nearest pavement.<br><br>When a safe coord could not be found the result of a function is false and outPosition == Vector3.Zero.<br><br>In the scripts these flags are used: 0, 14, 12, 16, 20, 21, 28. 0 is most commonly used, then 16. <br><br>16 works for me, 0 crashed the script. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="javascript">mp.game.pathfind.getSafeCoordForPed(x, y, z, onGround | <syntaxhighlight lang="javascript">mp.game.pathfind.getSafeCoordForPed(x, y, z, onGround, flags);</syntaxhighlight> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''x:''' float | *'''x:''' float | ||
| Line 7: | Line 7: | ||
*'''z:''' float | *'''z:''' float | ||
*'''onGround:''' Boolean | *'''onGround:''' Boolean | ||
*'''flags:''' int | *'''flags:''' int | ||
===Return value=== | ===Return value=== | ||
Revision as of 23:39, 21 October 2021
When onGround == true outPosition is a position located on the nearest pavement.
When a safe coord could not be found the result of a function is false and outPosition == Vector3.Zero.
In the scripts these flags are used: 0, 14, 12, 16, 20, 21, 28. 0 is most commonly used, then 16.
16 works for me, 0 crashed the script.
Syntax
mp.game.pathfind.getSafeCoordForPed(x, y, z, onGround, flags);
Required Arguments
- x: float
- y: float
- z: float
- onGround: Boolean
- flags: int
Return value
- Vector3
Example
// todo