GET_SAFE_COORD_FOR_PED
Finds a safe position for a ped near the given coordinates, writes it to outPosition and returns true on success.
Useful for spawning or teleporting peds without placing them inside geometry.
Signature
BOOL GET_SAFE_COORD_FOR_PED(float x, float y, float z, BOOL onGround, Vector3* outPosition, int flags); // 0xB61C8E878A4199CA b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | x | float |
| 2 | y | float |
| 3 | z | float |
| 4 | onGround | BOOL |
| 5 | outPosition | Vector3* (out pointer) |
| 6 | flags | int |
Facts
| Name | GET_SAFE_COORD_FOR_PED |
|---|---|
| Hash | 0xB61C8E878A4199CA |
| Namespace | |
| Returns | BOOL |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local result, outPosition = Citizen.InvokeNative(0xB61C8E878A4199CA, -- GET_SAFE_COORD_FOR_PED
0.0, -- float x
0.0, -- float y
0.0, -- float z
false, -- BOOL onGround
Citizen.PointerValueVector(), -- Vector3* outPosition
0, -- int flags
Citizen.ReturnResultAnyway()
)
if result then
-- ...
end// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const [result, outPosition] = Citizen.invokeNative("0xB61C8E878A4199CA", // GET_SAFE_COORD_FOR_PED
0.0, // float x
0.0, // float y
0.0, // float z
false, // BOOL onGround
Citizen.pointerValueVector(), // Vector3* outPosition
0, // int flags
Citizen.returnResultAnyway()
);
if (result) {
// ...
}var outPositionArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0xB61C8E878A4199CA, // GET_SAFE_COORD_FOR_PED
0.0f, // float x
0.0f, // float y
0.0f, // float z
false, // BOOL onGround
outPositionArg, // Vector3* outPosition
0 // int flags
);
Vector3 outPosition = outPositionArg.GetResult<Vector3>();Related PATH natives
- GET_APPROX_FLOOR_FOR_POINT
- _GET_SPAWN_DATA_FOR_ROAD_NODE
- GET_CLOSEST_ROAD
- GET_CLOSEST_VEHICLE_NODE
- GET_CLOSEST_VEHICLE_NODE_WITH_HEADING
- GET_GPS_BLIP_ROUTE_FOUND
- GET_GPS_BLIP_ROUTE_LENGTH
- GET_NTH_CLOSEST_VEHICLE_NODE
- GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
- GET_NTH_CLOSEST_VEHICLE_NODE_ID
- GET_NTH_CLOSEST_VEHICLE_NODE_ID_WITH_HEADING
- GET_NTH_CLOSEST_VEHICLE_NODE_WITH_HEADING
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.