Hand-written externs for natives whose Lua binding returns multiple values.

Many GTA natives report results through pointer output parameters. FiveM's Lua runtime drops those parameters from the call and appends them to the return values instead, but the natives database still describes them as ordinary arguments — so generate.py produces, for example:

static function getGroundZFor3DCoord(x:Float, y:Float, z:Float, groundZ:Dynamic, includeWater:Bool):Bool;

which type-checks but throws the ground height away. The declarations here model the real Lua signatures using @:multiReturn, so both halves of the result are reachable. They live outside natives/ so regeneration never overwrites them.

The wrappers in fivem.client.core use these; call them directly only if you need a native this library doesn't already wrap.

Static methods

@:value({ p2 : true })@:native("GetCurrentPedWeapon")staticgetCurrentPedWeapon(ped:Int, p2:Bool = true):CurrentWeaponResult

The weapon a ped currently has equipped.

@:native("GetEntityMatrix")staticgetEntityMatrix(entity:Int):EntityMatrixResult

An entity's basis vectors and position in one call.

@:native("GetEntityQuaternion")staticgetEntityQuaternion(entity:Int):QuaternionResult

An entity's orientation as a quaternion.

@:value({ includeWater : false })@:native("GetGroundZFor_3dCoord")staticgetGroundZFor3dCoord(x:Float, y:Float, z:Float, includeWater:Bool = false):GroundZResult

The ground height beneath a point. found is false when the collision around that spot isn't streamed in — which is the usual reason a spawn ends up under the map.

@:native("GetScreenCoordFromWorldCoord")staticgetScreenCoordFromWorldCoord(worldX:Float, worldY:Float, worldZ:Float):ScreenCoordResult

Projects a world position onto screen space, in 0..1 coordinates.

@:native("GetShapeTestResult")staticgetShapeTestResult(shapeTestHandle:Int):ShapeTestResult

Polls a shape test started with one of the START_SHAPE_TEST_* natives. status is 0 while pending, 1 when ready, 2 when the handle is invalid.

@:native("GetShapeTestResultIncludingMaterial")staticgetShapeTestResultIncludingMaterial(shapeTestHandle:Int):ShapeTestMaterialResult

As getShapeTestResult, but also reports the material that was hit.

@:native("GetVehicleColours")staticgetVehicleColours(vehicle:Int):VehicleColoursResult

A vehicle's primary and secondary paint indices.

@:native("GetVehicleExtraColours")staticgetVehicleExtraColours(vehicle:Int):VehicleColoursResult

A vehicle's pearlescent and wheel colour indices.