From 7b49cd40fb981211036d781ca8c36f8f45649bcf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:29:21 +0000 Subject: [PATCH] Release 2024-12-16 --- docs-gen/client-cfx.def.lua | 484 +++++++++++++++++++++++++++++++++--- docs-gen/server-cfx.def.lua | 274 +++++++++++++++++++- docs-gen/shared-cfx.def.lua | 121 +++++++-- 3 files changed, 825 insertions(+), 54 deletions(-) diff --git a/docs-gen/client-cfx.def.lua b/docs-gen/client-cfx.def.lua index 71edead..dab32fd 100644 --- a/docs-gen/client-cfx.def.lua +++ b/docs-gen/client-cfx.def.lua @@ -143,6 +143,23 @@ function RegisterStreamingFileFromKvs(kvsKey) end function GetVehicleWheelSpeed(vehicle, wheelIndex) end +--- An alternative to [SET_PED_PRELOAD_PROP_DATA](https://docs.fivem.net/natives/?_0x2B16A3BFF1FBCE49) that uses local collection indexing instead of the global one. +--- +--- The local / collection relative indexing is useful because the global index may get shifted after Title Update. While local index will remain the same which simplifies migration to the newer game version. +--- +--- Collection name and local index inside the collection can be obtained from the global index using [GET_PED_COLLECTION_NAME_FROM_PROP](https://docs.fivem.net/natives/?_0x8ED0C17) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_PROP](https://docs.fivem.net/natives/?_0xFBDB885F) natives. +--- +--- @hash [0x14B5BBE0](https://docs.fivem.net/natives/?_0x14B5BBE0) +--- @param ped Ped +--- @param anchorPoint number (int) +--- @param collection string (char*) +--- @param propIndex number (int) +--- @param textureId number (int) +--- @return void +--- @overload fun(ped: Ped, anchorPoint: number, collection: string, propIndex: number, textureId: number): void +function SetPedCollectionPreloadPropData(ped, anchorPoint, collection, propIndex, textureId) end + + --- FindFirstVehicle --- --- @hash [0x15E55694](https://docs.fivem.net/natives/?_0x15E55694) @@ -250,6 +267,15 @@ function MumbleSetAudioInputDistance(distance) end function RegisterFontFile(fileName) end +--- SetGlobalPassengerMassMultiplier +--- +--- @hash [0x1C47F6AC](https://docs.fivem.net/natives/?_0x1C47F6AC) +--- @param massMul number (float) +--- @return void +--- @overload fun(massMul: number): void +function SetGlobalPassengerMassMultiplier(massMul) end + + --- Injects a 'mouse up' event for a DUI object. Coordinates are expected to be set using SEND_DUI_MOUSE_MOVE. --- --- @hash [0x1D735B93](https://docs.fivem.net/natives/?_0x1D735B93) @@ -470,6 +496,22 @@ function GetVehicleHandlingInt(vehicle, class_, fieldName) end function GetPlayerMeleeWeaponDefenseModifier(playerId) end +--- Returns global drawable index based on the local one. Is it a reverse to [GET_PED_COLLECTION_NAME_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0xD6BBA48B) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0x94EB1FE4) natives. +--- +--- Drawables are stored inside collections. Each collection usually corresponds to a certain DCL or the base game. +--- +--- If all drawables from all collections are placed into one continuous array - the global index will correspond to the index of drawable in such array. Local index is index of drawable in this array relative to the start of the given collection. +--- +--- @hash [0x280F1FC3](https://docs.fivem.net/natives/?_0x280F1FC3) +--- @param ped Ped +--- @param componentId number (int) +--- @param collection string (char*) +--- @param drawableId number (int) +--- @return number +--- @overload fun(ped: Ped, componentId: number, collection: string, drawableId: number): number +function GetPedDrawableGlobalIndexFromCollection(ped, componentId, collection, drawableId) end + + --- Removes vehicle xenon lights custom RGB color. --- --- @hash [0x2867ED8C](https://docs.fivem.net/natives/?_0x2867ED8C) @@ -586,35 +628,6 @@ function GetRopeUpdateOrder(rope) end function GetVehicleWheelSuspensionCompression(vehicle, wheelIndex) end ---- Returns a list of entity handles (script GUID) for all entities in the specified pool - the data returned is an array as ---- follows: ---- ---- ```json ---- [ 770, 1026, 1282, 1538, 1794, 2050, 2306, 2562, 2818, 3074, 3330, 3586, 3842, 4098, 4354, 4610, ...] ---- ``` ---- ---- ### Supported pools ---- ---- * `CPed`: Peds (including animals) and players. ---- * `CObject`: Objects (props), doors, and projectiles. ---- * `CVehicle`: Vehicles. ---- * `CPickup`: Pickups. ---- @usage local vehiclePool = GetGamePool('CVehicle') -- Get the list of vehicles (entities) from the pool ---- for i = 1, #vehiclePool do -- loop through each vehicle (entity) ---- if GetPedInVehicleSeat(vehiclePool[i], -1) == 0 then ---- DeleteEntity(vehiclePool[i]) -- Delete vehicles (entities) that don't have a driver ---- end ---- en ---- @hash [0x2B9D4F50](https://docs.fivem.net/natives/?_0x2B9D4F50) ---- @param poolName string (char*) ---- @return (Ped|Object|Vehicle|Pickup)[] ---- @overload fun(poolname: 'CPed'): Ped[] ---- @overload fun(poolname: 'CObject'): Object[] ---- @overload fun(poolname: 'CVehicle'): Vehicle[] ---- @overload fun(poolname: 'CPickup'): Pickup[] -function GetGamePool(poolName) end - - --- Sets a handling override for a specific vehicle. Certain handling flags can only be set globally using `SET_HANDLING_FIELD`, this might require some experimentation. --- Example: `SetVehicleHandlingField(vehicle, 'CHandlingData', 'fSteeringLock', 360.0)` --- @@ -658,6 +671,22 @@ function GetMapdataEntityMatrix(mapDataHash, entityInternalIdx, matrixPtr) end function GetNetworkWalkMode() end +--- Returns global prop index based on the local one. Is it a reverse to [GET_PED_COLLECTION_NAME_FROM_PROP](https://docs.fivem.net/natives/?_0x8ED0C17) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_PROP](https://docs.fivem.net/natives/?_0xFBDB885F) natives. +--- +--- Props are stored inside collections. Each collection usually corresponds to a certain DCL or the base game. +--- +--- If all props from all collections are placed into one continuous array - the global index will correspond to the index of the prop in such array. Local index is index of the prop in this array relative to the start of the given collection. +--- +--- @hash [0x2CB45CDC](https://docs.fivem.net/natives/?_0x2CB45CDC) +--- @param ped Ped +--- @param anchorPoint number (int) +--- @param collection string (char*) +--- @param propIndex number (int) +--- @return number +--- @overload fun(ped: Ped, anchorPoint: number, collection: string, propIndex: number): number +function GetPedPropGlobalIndexFromCollection(ped, anchorPoint, collection, propIndex) end + + --- Injects a 'mouse wheel' event for a DUI object. --- --- @hash [0x2D62133A](https://docs.fivem.net/natives/?_0x2D62133A) @@ -722,6 +751,17 @@ function GetWeaponComponentRangeModifier(componentHash) end function GetMapdataEntityHandle(mapDataHash, entityInternalIdx, entityHandle) end +--- An analogue of [GET_NUMBER_OF_PED_DRAWABLE_VARIATIONS](https://docs.fivem.net/natives/?_0x27561561732A7842) that returns number of drawable variations inside a single collection instead of the total number across all collections. +--- +--- @hash [0x310D0271](https://docs.fivem.net/natives/?_0x310D0271) +--- @param ped Ped +--- @param componentId number (int) +--- @param collection string (char*) +--- @return number +--- @overload fun(ped: Ped, componentId: number, collection: string): number +function GetNumberOfPedCollectionDrawableVariations(ped, componentId, collection) end + + --- Disables the game's built-in auto-reloading. --- --- @hash [0x311150E5](https://docs.fivem.net/natives/?_0x311150E5) @@ -786,6 +826,22 @@ function MumbleAddVoiceTargetPlayer(targetId, player) end function AddTextEntry(entryKey, entryText) end +--- An alternative to [IS_PED_COMPONENT_VARIATION_GEN9\_EXCLUSIVE](https://docs.fivem.net/natives/?_0xC767B581) that uses local collection indexing instead of the global one. +--- +--- The local / collection relative indexing is useful because the global index may get shifted after Title Update. While local index will remain the same which simplifies migration to the newer game version. +--- +--- Collection name and local index inside the collection can be obtained from the global index using [GET_PED_COLLECTION_NAME_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0xD6BBA48B) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0x94EB1FE4) natives. +--- +--- @hash [0x33B2AFA2](https://docs.fivem.net/natives/?_0x33B2AFA2) +--- @param ped Ped +--- @param componentId number (int) +--- @param collection string (char*) +--- @param drawableId number (int) +--- @return boolean +--- @overload fun(ped: Ped, componentId: number, collection: string, drawableId: number): boolean +function IsPedCollectionComponentVariationGen9Exclusive(ped, componentId, collection, drawableId) end + + --- MumbleIsPlayerTalking --- --- @hash [0x33EEF97F](https://docs.fivem.net/natives/?_0x33EEF97F) @@ -795,6 +851,19 @@ function AddTextEntry(entryKey, entryText) end function MumbleIsPlayerTalking(player) end +--- ApplyWeatherCycles +--- @usage -- Cycle between XMAS weather for 30 seconds (3 * 10000 milliseconds), and SMOG weather for 20 seconds (2 * 10000 milliseconds) +--- local success = SetWeatherCycleEntry(0, "XMAS", 3) and +--- SetWeatherCycleEntry(1, "SMOG", 2) and +--- ApplyWeatherCycles(2, 10000 +--- @hash [0x3422291C](https://docs.fivem.net/natives/?_0x3422291C) +--- @param numEntries number (int) +--- @param msPerCycle number (int) +--- @return boolean +--- @overload fun(numEntries: number, msPerCycle: number): boolean +function ApplyWeatherCycles(numEntries, msPerCycle) end + + --- Gets a local client's Player ID from its server ID counterpart, assuming the passed `serverId` exists on the client. --- --- If no matching client is found, or an invalid value is passed over as the `serverId` native's parameter, the native result will be `-1`. @@ -916,6 +985,27 @@ function SetRuntimeTextureArgbData(tex, buffer, length) end function IsNuiFocusKeepingInput() end +--- SetVehicleNextGear +--- +--- @hash [0x3A4566F4](https://docs.fivem.net/natives/?_0x3A4566F4) +--- @param vehicle Vehicle +--- @param nextGear number (int) +--- @return void +--- @overload fun(vehicle: Vehicle, nextGear: number): void +function SetVehicleNextGear(vehicle, nextGear) end + + +--- An analogue of [GET_NUMBER_OF_PED_PROP_DRAWABLE_VARIATIONS](https://docs.fivem.net/natives/?_0x5FAF9754E789FB47) that returns number of prop variations inside a single collection instead of the total number across all collections. +--- +--- @hash [0x3B6A13E1](https://docs.fivem.net/natives/?_0x3B6A13E1) +--- @param ped Ped +--- @param anchorPoint number (int) +--- @param collection string (char*) +--- @return number +--- @overload fun(ped: Ped, anchorPoint: number, collection: string): number +function GetNumberOfPedCollectionPropDrawableVariations(ped, anchorPoint, collection) end + + --- See [GET_TIMECYCLE_VAR_COUNT](https://docs.fivem.net/natives/?_0x838B34D8). --- @usage local varCount = GetTimecycleVarCount() --- @@ -1041,6 +1131,23 @@ function SelectEntityAtCursor(hitFlags, precise) end function SetMinimapComponentPosition(name, alignX, alignY, posX, posY, sizeX, sizeY) end +--- An alternative to [SET_PED_PRELOAD_VARIATION_DATA](https://docs.fivem.net/natives/?_0x39D55A620FCB6A3A) that uses local collection indexing instead of the global one. +--- +--- The local / collection relative indexing is useful because the global index may get shifted after Title Update. While local index will remain the same which simplifies migration to the newer game version. +--- +--- Collection name and local index inside the collection can be obtained from the global index using [GET_PED_COLLECTION_NAME_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0x5C612867) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0x94EB1FE4) natives. +--- +--- @hash [0x3EC75558](https://docs.fivem.net/natives/?_0x3EC75558) +--- @param ped Ped +--- @param componentId number (int) +--- @param collection string (char*) +--- @param drawableId number (int) +--- @param textureId number (int) +--- @return void +--- @overload fun(ped: Ped, componentId: number, collection: string, drawableId: number, textureId: number): void +function SetPedCollectionPreloadVariationData(ped, componentId, collection, drawableId, textureId) end + + --- GetInteriorPortalRoomTo --- @usage local playerPed = PlayerPedId() --- local interiorId = GetInteriorFromEntity(playerPed) @@ -1122,16 +1229,31 @@ function GetTrainDoorOpenRatio(train, doorIndex) end function FindNextPickup(findHandle, outEntity) end ---- **Experimental**: This native may be altered or removed in future versions of CitizenFX without warning. +--- Overwrite the games default CPortalTracker interior detection range. +--- This fixes potentially unwanted behaviour in the base game and allows you to build custom interiors with larger ceiling heights without running into graphical glitches. --- ---- Registers a set of entities with the game engine. These should match `CEntityDef` class information from the game. ---- At this time, this function **should not be used in a live environment**. ---- ---- @hash [0x410DA7D3](https://docs.fivem.net/natives/?_0x410DA7D3) ---- @param factory fun +--- By default CPortalTracker will probe 4 units downward trying to reach collisions that are part of the interior the entity is in. +--- If no collision can be found 16 units are used in some circumstances. +--- +--- There are 30+ hard coded special cases, only some of them exposed via script (for example `ENABLE_STADIUM_PROBES_THIS_FRAME`). +--- +--- This native allows you to extend the probe range up to 150 units which is the same value the game uses for the `xs_arena_interior` +--- @usage RegisterCommand("setInteriorProbeLength", function(src, args, raw) +--- local probeLength = (tonumber(args[1]) + 0.0) +--- +--- print("Extending interior detection probes to: ", probeLength) +--- SetInteriorProbeLength(probeLength) +--- end) +--- +--- RegisterCommand("resetInteriorProbeLength", function() +--- print("Resetting interior detection probes to default settings") +--- SetInteriorProbeLength(0.0) +--- end +--- @hash [0x423F7E39](https://docs.fivem.net/natives/?_0x423F7E39) +--- @param probeLength number (float) --- @return void ---- @overload fun(factory: fun): void -function RegisterEntities(factory) end +--- @overload fun(probeLength: number): void +function SetInteriorProbeLength(probeLength) end --- GetWaterQuadBounds @@ -1166,6 +1288,23 @@ function SetMapZoomDataLevel(index, zoomScale, zoomSpeed, scrollSpeed, tilesX, t function GetPedSweat(ped) end +--- Returns number of variation collections available for the given Ped. +--- +--- Collections are groups of drawable components or props available for the given Ped. Usually collection corresponds to a certain DLC or the base game. See [SET_PED_COLLECTION_COMPONENT_VARIATION](https://docs.fivem.net/natives/?_0x88711BBA), [SET_PED_COLLECTION_PROP_INDEX](https://docs.fivem.net/natives/?_0x75240BCB), [GET_NUMBER_OF_PED_COLLECTION_DRAWABLE_VARIATIONS](https://docs.fivem.net/natives/?_0x310D0271) etc natives for more details on how to work with collections. +--- +--- `GET_PED_COLLECTIONS_COUNT` can be used together with [GET_PED_COLLECTION_NAME](https://docs.fivem.net/natives/?_0xFED5D83A) to list all collections attached to Ped. +--- @usage local ped = PlayerPedId() +--- local count = GetPedCollectionsCount(ped) +--- for i = 0, count - 1 do +--- print(GetPedCollectionName(ped, i)) +--- en +--- @hash [0x45946359](https://docs.fivem.net/natives/?_0x45946359) +--- @param ped Ped +--- @return number +--- @overload fun(ped: Ped): number +function GetPedCollectionsCount(ped) end + + --- Overrides a ped model personality type. --- --- @hash [0x46F6B38B](https://docs.fivem.net/natives/?_0x46F6B38B) @@ -1961,6 +2100,36 @@ function MumbleSetAudioOutputDistance(distance) end function MumbleSetTalkerProximity(value) end +--- An alternative to [SET_PED_PROP_INDEX](https://docs.fivem.net/natives/?_0x93376B65A266EB5F) that uses local collection indexing instead of the global one. +--- +--- The local / collection relative indexing is useful because the global index may get shifted after Title Update. While local index will remain the same which simplifies migration to the newer game version. +--- +--- Collection name and local index inside the collection can be obtained from the global index using [GET_PED_COLLECTION_NAME_FROM_PROP](https://docs.fivem.net/natives/?_0x8ED0C17) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_PROP](https://docs.fivem.net/natives/?_0xFBDB885F) natives. +--- +--- @hash [0x75240BCB](https://docs.fivem.net/natives/?_0x75240BCB) +--- @param ped Ped +--- @param anchorPoint number (int) +--- @param collection string (char*) +--- @param propIndex number (int) +--- @param textureId number (int) +--- @param attach boolean +--- @return void +--- @overload fun(ped: Ped, anchorPoint: number, collection: string, propIndex: number, textureId: number, attach: boolean): void +function SetPedCollectionPropIndex(ped, anchorPoint, collection, propIndex, textureId, attach) end + + +--- An alternative to [GET_NUMBER_OF_PED_PROP_TEXTURE_VARIATIONS](https://docs.fivem.net/natives/?_0xA6E7F1CEB523E171) that uses local collection indexing instead of the global one. +--- +--- @hash [0x75CAF9CC](https://docs.fivem.net/natives/?_0x75CAF9CC) +--- @param ped Ped +--- @param anchorPoint number (int) +--- @param collection string (char*) +--- @param propIndex number (int) +--- @return number +--- @overload fun(ped: Ped, anchorPoint: number, collection: string, propIndex: number): number +function GetNumberOfPedCollectionPropTextureVariations(ped, anchorPoint, collection, propIndex) end + + --- Returns all rope handles. The data returned adheres to the following layout: --- --- ``` @@ -2070,6 +2239,15 @@ function SendNuiMessage(jsonString) end function CreateRuntimeTextureFromImage(txd, txn, fileName) end +--- A getter for [SET_GLOBAL_PASSENGER_MASS_MULTIPLIER](https://docs.fivem.net/natives/?_0x1c47f6ac). +--- +--- @hash [0x78951816](https://docs.fivem.net/natives/?_0x78951816) +--- +--- @return number +--- @overload fun(): number +function GetGlobalPassengerMassMultiplier() end + + --- A getter for [SET_PLAYER_VEHICLE_DAMAGE_MODIFIER](https://docs.fivem.net/natives/?_0xA50E117CDDF82F0C). --- --- @hash [0x78F27B1F](https://docs.fivem.net/natives/?_0x78F27B1F) @@ -2511,6 +2689,24 @@ function SetInteriorPortalCornerPosition(interiorId, portalIndex, cornerIndex, p function FindNextVehicle(findHandle, outEntity) end +--- An alternative to [SET_PED_COMPONENT_VARIATION](https://docs.fivem.net/natives/?_0x262B14F48D29DE80) that uses local collection indexing instead of the global one. +--- +--- The local / collection relative indexing is useful because the global index may get shifted after Title Update. While local index will remain the same which simplifies migration to the newer game version. +--- +--- Collection name and local index inside the collection can be obtained from the global index using [GET_PED_COLLECTION_NAME_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0xD6BBA48B) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0x94EB1FE4) natives. +--- +--- @hash [0x88711BBA](https://docs.fivem.net/natives/?_0x88711BBA) +--- @param ped Ped +--- @param componentId number (int) +--- @param collection string (char*) +--- @param drawableId number (int) +--- @param textureId number (int) +--- @param paletteId number (int) +--- @return void +--- @overload fun(ped: Ped, componentId: number, collection: string, drawableId: number, textureId: number, paletteId: number): void +function SetPedCollectionComponentVariation(ped, componentId, collection, drawableId, textureId, paletteId) end + + --- SetInteriorPortalFlag --- @usage local playerPed = PlayerPedId() --- local interiorId = GetInteriorFromEntity(playerPed) @@ -2542,6 +2738,37 @@ function SetInteriorPortalFlag(interiorId, portalIndex, flag) end function MumbleRemoveVoiceTargetPlayer(targetId, player) end +--- SetVehicleCurrentGear +--- +--- @hash [0x8923DD42](https://docs.fivem.net/natives/?_0x8923DD42) +--- @param vehicle Vehicle +--- @param gear number (int) +--- @return void +--- @overload fun(vehicle: Vehicle, gear: number): void +function SetVehicleCurrentGear(vehicle, gear) end + + +--- Allows StaticEmitter's without a linked entity to make use of environment features like occlusion and reverb even if they are located higher than 20.0 units above any static collision inside interiors. +--- +--- This native allows you to extend the probe range up to 150.0 units. +--- @usage RegisterCommand("setEmitterProbeLength", function(src, args, raw) +--- local probeLength = (tonumber(args[1]) + 0.0) +--- +--- print("Extending emitter probes to: ", probeLength) +--- SetEmitterProbeLength(probeLength) +--- end) +--- +--- RegisterCommand("resetEmitterProbeLength", function() +--- print("Resetting emitter probes to default settings") +--- SetEmitterProbeLength(20.0) +--- end +--- @hash [0x8AA1F3C2](https://docs.fivem.net/natives/?_0x8AA1F3C2) +--- @param probeLength number (float) +--- @return void +--- @overload fun(probeLength: number): void +function SetEmitterProbeLength(probeLength) end + + --- Sets a global handling override for a specific vehicle class. The name is supposed to match the `handlingName` field from handling.meta. --- --- @hash [0x8AB3F46C](https://docs.fivem.net/natives/?_0x8AB3F46C) @@ -2585,6 +2812,23 @@ function GetVehicleDashboardWaterTemp() end function SetPedMeleeCombatLimits(primaryCount, secondaryCount, populationPedCount) end +--- Gets collection name for the given global prop index. Together with [GET_PED_COLLECTION_LOCAL_INDEX_FROM_PROP](https://docs.fivem.net/natives/?_0xFBDB885F) is used to get collection and local index (inside the given collection) of the prop. The collection name and index are used in functions like [SET_PED_COLLECTION_PROP_INDEX](https://docs.fivem.net/natives/?_0x75240BCB). +--- @usage local ped = PlayerPedId() +--- -- Hat for mp_f_freemode_01. From female_freemode_beach collection under index 1. +--- -- Global index is 21 because there is 20 head prop variations in the base game collection that goes before the female_freemode_beach collection. +--- local name = GetPedPropCollectionName(ped, 0, 21) +--- local index = GetPedPropCollectionLocalIndex(ped, 0, 21) +--- -- Equivalent to SetPedPropIndex(ped, 0, 21, 0, false) +--- SetPedCollectionPropIndex(ped, 0, name, index, 0, false +--- @hash [0x8ED0C17](https://docs.fivem.net/natives/?_0x8ED0C17) +--- @param ped Ped +--- @param anchorPoint number (int) +--- @param propIndex number (int) +--- @return string +--- @overload fun(ped: Ped, anchorPoint: number, propIndex: number): string +function GetPedCollectionNameFromProp(ped, anchorPoint, propIndex) end + + --- Equivalent of [START_FIND_KVP](https://docs.fivem.net/natives/?_0xDD379006), but for another resource than the current one. --- @usage local kvpHandle = StartFindExternalKvp('drugs', 'mollis:') --- @@ -2597,9 +2841,11 @@ function SetPedMeleeCombatLimits(primaryCount, secondaryCount, populationPedCoun --- if key then --- print(('%s: %s'):format(key, GetResourceKvpString(key))) --- end ---- until key +--- until not key --- --- EndFindKvp(kvpHandle) +--- else +--- print('No KVPs found') --- en --- @hash [0x8F2EECC3](https://docs.fivem.net/natives/?_0x8F2EECC3) --- @param resourceName string (char*) @@ -2704,6 +2950,23 @@ function GetWaveQuadCount() end function MumbleRemoveVoiceTargetPlayerByServerId(targetId, serverId) end +--- Gets local index inside a collection (which can be obtained using [GET_PED_COLLECTION_NAME_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0xD6BBA48B)) for the given global drawable ID. The collection name and index are used in functions like [SET_PED_COLLECTION_COMPONENT_VARIATION](https://docs.fivem.net/natives/?_0x88711BBA). +--- @usage local ped = PlayerPedId() +--- -- Top for mp_f_freemode_01. From female_freemode_beach collection under index 1. +--- -- Global index is 17 because there is 16 top variations in the base game collection that goes before the female_freemode_beach collection. +--- local name = GetPedDrawableCollectionName(ped, 11, 17) +--- local index = GetPedDrawableCollectionLocalIndex(ped, 11, 17) +--- -- Equivalent to SetPedComponentVariation(ped, 11, 17, 0, 0) +--- SetPedCollectionComponentVariation(ped, 11, name, index, 0, 0 +--- @hash [0x94EB1FE4](https://docs.fivem.net/natives/?_0x94EB1FE4) +--- @param ped Ped +--- @param componentId number (int) +--- @param drawableId number (int) +--- @return number +--- @overload fun(ped: Ped, componentId: number, drawableId: number): number +function GetPedCollectionLocalIndexFromDrawable(ped, componentId, drawableId) end + + --- GetVehicleSteeringScale --- --- @hash [0x954465DE](https://docs.fivem.net/natives/?_0x954465DE) @@ -2759,6 +3022,16 @@ function IsNuiFocused() end function SetWeaponRecoilShakeAmplitude(weaponHash, amplitude) end +--- An analogue to [GET_PED_DRAWABLE_VARIATION](https://docs.fivem.net/natives/?_0x67F3780DD425D4FC) that returns collection local drawable index (inside [GET_PED_DRAWABLE_VARIATION_COLLECTION_NAME](https://docs.fivem.net/natives/?_0xBCE0AB63) collection) instead of the global drawable index. +--- +--- @hash [0x9970386F](https://docs.fivem.net/natives/?_0x9970386F) +--- @param ped Ped +--- @param componentId number (int) +--- @return number +--- @overload fun(ped: Ped, componentId: number): number +function GetPedDrawableVariationCollectionLocalIndex(ped, componentId) end + + --- A getter for [MODIFY_VEHICLE_TOP_SPEED](https://docs.fivem.net/natives/?_0x93A3996368C94158). Returns -1.0 if a modifier is not set. --- --- @hash [0x998B7FEE](https://docs.fivem.net/natives/?_0x998B7FEE) @@ -2810,6 +3083,19 @@ function GetInteriorPortalEntityArchetype(interiorId, portalIndex, entityIndex) function SetAudioSubmixEffectParamFloat(submixId, effectSlot, paramIndex, paramValue) end +--- **Experimental**: This native may be altered or removed in future versions of CitizenFX without warning. +--- +--- Returns the memory address of an entity. +--- +--- This native is intended for singleplayer debugging, and may not be available during multiplayer. +--- +--- @hash [0x9A3144BC](https://docs.fivem.net/natives/?_0x9A3144BC) +--- @param entity Entity +--- @return any +--- @overload fun(entity: Entity): any +function GetEntityAddress(entity) end + + --- GetVehicleDashboardSpeed --- --- @hash [0x9AAD420E](https://docs.fivem.net/natives/?_0x9AAD420E) @@ -3542,6 +3828,18 @@ function GetPedFaceFeature(ped, index) end function SetVehicleFuelLevel(vehicle, level) end +--- An analogue to [GET_PED_DRAWABLE_VARIATION](https://docs.fivem.net/natives/?_0x67F3780DD425D4FC) that returns collection name instead of the global drawable index. +--- +--- Should be used together with [GET_PED_DRAWABLE_VARIATION_COLLECTION_LOCAL_INDEX](https://docs.fivem.net/natives/?_0x9970386F). +--- +--- @hash [0xBCE0AB63](https://docs.fivem.net/natives/?_0xBCE0AB63) +--- @param ped Ped +--- @param componentId number (int) +--- @return string +--- @overload fun(ped: Ped, componentId: number): string +function GetPedDrawableVariationCollectionName(ped, componentId) end + + --- Draw a glow sphere this frame. Up to 256 per single frame. --- --- @hash [0xBD25EC89](https://docs.fivem.net/natives/?_0xBD25EC89) @@ -3940,6 +4238,32 @@ function GetRuntimeTextureWidth(tex) end function GetRuntimeTexturePitch(tex) end +--- An alternative to [IS_PED_COMPONENT_VARIATION_VALID](https://docs.fivem.net/natives/?_0xE825F6B6CEA7671D) that uses local collection indexing instead of the global one. +--- +--- The local / collection relative indexing is useful because the global index may get shifted after Title Update. While local index will remain the same which simplifies migration to the newer game version. +--- +--- Collection name and local index inside the collection can be obtained from the global index using [GET_PED_COLLECTION_NAME_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0xD6BBA48B) and [GET_PED_COLLECTION_LOCAL_INDEX_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0x94EB1FE4) natives. +--- +--- @hash [0xCA63A52A](https://docs.fivem.net/natives/?_0xCA63A52A) +--- @param ped Ped +--- @param componentId number (int) +--- @param collection string (char*) +--- @param drawableId number (int) +--- @param textureId number (int) +--- @return boolean +--- @overload fun(ped: Ped, componentId: number, collection: string, drawableId: number, textureId: number): boolean +function IsPedCollectionComponentVariationValid(ped, componentId, collection, drawableId, textureId) end + + +--- Toggles the visibility of resource names in the FiveM key mapping page. +--- +--- @hash [0xCB0241B5](https://docs.fivem.net/natives/?_0xCB0241B5) +--- @param hide boolean +--- @return void +--- @overload fun(hide: boolean): void +function SetKeyMappingHideResources(hide) end + + --- Sets a clickable button to be displayed in a player's Discord rich presence. --- --- @hash [0xCBBC3FAC](https://docs.fivem.net/natives/?_0xCBBC3FAC) @@ -3951,6 +4275,15 @@ function GetRuntimeTexturePitch(tex) end function SetDiscordRichPresenceAction(index, label, url) end +--- Check whether specified channel exists on the Mumble server. +--- +--- @hash [0xCC8CA25](https://docs.fivem.net/natives/?_0xCC8CA25) +--- @param channel number (int) +--- @return boolean +--- @overload fun(channel: number): boolean +function MumbleDoesChannelExist(channel) end + + --- Returns the offset of the specified wheel relative to the wheel's axle center. --- --- @hash [0xCC90CBCA](https://docs.fivem.net/natives/?_0xCC90CBCA) @@ -4129,6 +4462,17 @@ function SetWaterQuadHasLimitedDepth(waterQuad, hasLimitedDepth) end function GetVehicleWheelPower(vehicle, wheelIndex) end +--- SetWeatherCycleEntry +--- +--- @hash [0xD264D4E1](https://docs.fivem.net/natives/?_0xD264D4E1) +--- @param index number (int) +--- @param typeName string (char*) +--- @param timeMult number (int) +--- @return boolean +--- @overload fun(index: number, typeName: string, timeMult: number): boolean +function SetWeatherCycleEntry(index, typeName, timeMult) end + + --- Returns the transient map data index for a specified hash. --- This function supports SDK infrastructure and is not intended to be used directly from your code. --- @@ -4151,6 +4495,18 @@ function GetMapdataFromHashKey(mapdataHandle) end function SetVehicleWheelFlags(vehicle, wheelIndex, flags) end +--- An alternative to [GET_NUMBER_OF_PED_TEXTURE_VARIATIONS](https://docs.fivem.net/natives/?_0x8F7156A3142A6BAD) that uses local collection indexing instead of the global one. +--- +--- @hash [0xD2C15D7](https://docs.fivem.net/natives/?_0xD2C15D7) +--- @param ped Ped +--- @param componentId number (int) +--- @param collection string (char*) +--- @param drawableId number (int) +--- @return number +--- @overload fun(ped: Ped, componentId: number, collection: string, drawableId: number): number +function GetNumberOfPedCollectionTextureVariations(ped, componentId, collection, drawableId) end + + --- This native is not implemented. --- --- @hash [0xD2CB95A3](https://docs.fivem.net/natives/?_0xD2CB95A3) @@ -4197,6 +4553,23 @@ function SetTrainsForceDoorsOpen(forceOpen) end function SetMpGamerTagsVisibleDistance(distance) end +--- Gets collection name for the given global drawable ID. Together with [GET_PED_COLLECTION_LOCAL_INDEX_FROM_DRAWABLE](https://docs.fivem.net/natives/?_0x94EB1FE4) is used to get collection and local index (inside the given collection) of the drawable. The collection name and index are used in functions like [SET_PED_COLLECTION_COMPONENT_VARIATION](https://docs.fivem.net/natives/?_0x88711BBA). +--- @usage local ped = PlayerPedId() +--- -- Top for mp_f_freemode_01. From female_freemode_beach collection under index 1. +--- -- Global index is 17 because there is 16 top variations in the base game collection that goes before the female_freemode_beach collection. +--- local name = GetPedDrawableCollectionName(ped, 11, 17) +--- local index = GetPedDrawableCollectionLocalIndex(ped, 11, 17) +--- -- Equivalent to SetPedComponentVariation(ped, 11, 17, 0, 0) +--- SetPedCollectionComponentVariation(ped, 11, name, index, 0, 0 +--- @hash [0xD6BBA48B](https://docs.fivem.net/natives/?_0xD6BBA48B) +--- @param ped Ped +--- @param componentId number (int) +--- @param drawableId number (int) +--- @return string +--- @overload fun(ped: Ped, componentId: number, drawableId: number): string +function GetPedCollectionNameFromDrawable(ped, componentId, drawableId) end + + --- Returns all registered vehicle model names, including non-dlc vehicles and custom vehicles in no particular order. --- --- **Example output** @@ -5104,6 +5477,23 @@ function SetEntityMatrix(entity, forwardX, forwardY, forwardZ, rightX, rightY, r function GetVehicleHandlingVector(vehicle, class_, fieldName) end +--- Gets local index inside a collection (which can be obtained using [GET_PED_COLLECTION_NAME_FROM_PROP](https://docs.fivem.net/natives/?_0x8ED0C17)) for the given global prop index. The collection name and index are used in functions like [SET_PED_COLLECTION_PROP_INDEX](https://docs.fivem.net/natives/?_0x75240BCB). +--- @usage local ped = PlayerPedId() +--- -- Hat for mp_f_freemode_01. From female_freemode_beach collection under index 1. +--- -- Global index is 21 because there is 20 head prop variations in the base game collection that goes before the female_freemode_beach collection. +--- local name = GetPedPropCollectionName(ped, 0, 21) +--- local index = GetPedPropCollectionLocalIndex(ped, 0, 21) +--- -- Equivalent to SetPedPropIndex(ped, 0, 21, 0, false) +--- SetPedCollectionPropIndex(ped, 0, name, index, 0, false +--- @hash [0xFBDB885F](https://docs.fivem.net/natives/?_0xFBDB885F) +--- @param ped Ped +--- @param anchorPoint number (int) +--- @param propIndex number (int) +--- @return number +--- @overload fun(ped: Ped, anchorPoint: number, propIndex: number): number +function GetPedCollectionLocalIndexFromProp(ped, anchorPoint, propIndex) end + + --- the status of default voip system. It affects on `NETWORK_IS_PLAYER_TALKING` and `mp_facial` animation. --- This function doesn't need to be called every frame, it works like a switcher. --- @@ -5204,6 +5594,24 @@ function SetHandlingField(vehicle, class_, fieldName, value) end function CreateRuntimeTexture(txd, txn, width, height) end +--- Returns name of collection under given index for the given Ped. +--- +--- Collections are groups of drawable components or props available for the given Ped. Usually collection corresponds to a certain DLC or the base game. See [SET_PED_COLLECTION_COMPONENT_VARIATION](https://docs.fivem.net/natives/?_0x88711BBA), [SET_PED_COLLECTION_PROP_INDEX](https://docs.fivem.net/natives/?_0x75240BCB), [GET_NUMBER_OF_PED_COLLECTION_DRAWABLE_VARIATIONS](https://docs.fivem.net/natives/?_0x310D0271) etc natives for more details on how to work with collections. +--- +--- `GET_PED_COLLECTION_NAME` can be used together with [GET_PED_COLLECTIONS_COUNT](https://docs.fivem.net/natives/?_0x45946359) to list all collections attached to Ped. +--- @usage local ped = PlayerPedId() +--- local count = GetPedCollectionsCount(ped) +--- for i = 0, count - 1 do +--- print(GetPedCollectionName(ped, i)) +--- en +--- @hash [0xFED5D83A](https://docs.fivem.net/natives/?_0xFED5D83A) +--- @param ped Ped +--- @param index number (int) +--- @return string +--- @overload fun(ped: Ped, index: number): string +function GetPedCollectionName(ped, index) end + + --- GetCalmingQuadBounds --- @usage local success, minX, minY, maxX, maxY = GetCalmingQuadBounds(1 --- @hash [0xFF60E63](https://docs.fivem.net/natives/?_0xFF60E63) diff --git a/docs-gen/server-cfx.def.lua b/docs-gen/server-cfx.def.lua index 972fc53..a09f4cb 100644 --- a/docs-gen/server-cfx.def.lua +++ b/docs-gen/server-cfx.def.lua @@ -27,6 +27,15 @@ function DoesPlayerExist(playerSrc) end +--- GetHeliRollControl +--- +--- @hash [0x12948DE9](https://docs.fivem.net/natives/?_0x12948DE9) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliRollControl(heli) end + + --- FlagServerAsPrivate --- --- @hash [0x13B6855D](https://docs.fivem.net/natives/?_0x13B6855D) @@ -46,6 +55,24 @@ function FlagServerAsPrivate(private_) end function DoesPlayerOwnSku(playerSrc, skuId) end +--- GetHeliPitchControl +--- +--- @hash [0x1944AC95](https://docs.fivem.net/natives/?_0x1944AC95) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliPitchControl(heli) end + + +--- GetThrusterSideRcsThrottle +--- +--- @hash [0x1C939E87](https://docs.fivem.net/natives/?_0x1C939E87) +--- @param jetpack Vehicle +--- @return number +--- @overload fun(jetpack: Vehicle): number +function GetThrusterSideRcsThrottle(jetpack) end + + --- Requests whether or not the commerce data for the specified player has loaded from Tebex. --- --- @hash [0x1D14F4FE](https://docs.fivem.net/natives/?_0x1D14F4FE) @@ -92,6 +119,15 @@ function NetworkGetFirstEntityOwner(entity) end function StopResource(resourceName) end +--- GetHeliTailRotorDamageScale +--- +--- @hash [0x22239130](https://docs.fivem.net/natives/?_0x22239130) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliTailRotorDamageScale(heli) end + + --- GetPasswordHash --- --- @hash [0x23473EA4](https://docs.fivem.net/natives/?_0x23473EA4) @@ -101,6 +137,15 @@ function StopResource(resourceName) end function GetPasswordHash(password) end +--- This is a getter for [SET_HELI_TAIL_EXPLODE_THROW_DASHBOARD](https://docs.fivem.net/natives/?_0x3EC8BF18AA453FE9) +--- +--- @hash [0x23E46BD7](https://docs.fivem.net/natives/?_0x23E46BD7) +--- @param heli Vehicle +--- @return boolean +--- @overload fun(heli: Vehicle): boolean +function IsHeliTailBoomBreakable(heli) end + + --- IsPedHandcuffed --- --- @hash [0x25865633](https://docs.fivem.net/natives/?_0x25865633) @@ -169,6 +214,15 @@ function RegisterResourceBuildTaskFactory(factoryId, factoryFn) end function StartResource(resourceName) end +--- IsHeliTailBoomBroken +--- +--- @hash [0x2C59F987](https://docs.fivem.net/natives/?_0x2C59F987) +--- @param heli Vehicle +--- @return boolean +--- @overload fun(heli: Vehicle): boolean +function IsHeliTailBoomBroken(heli) end + + --- VerifyPasswordHash --- --- @hash [0x2E310ACD](https://docs.fivem.net/natives/?_0x2E310ACD) @@ -205,6 +259,15 @@ function TriggerClientEventInternal(eventName, eventTarget, eventPayload, payloa function GetAllVehicles() end +--- This native is a getter for [SET_HELI_TAIL_ROTOR_HEALTH](https://docs.fivem.net/natives/?_0xFE205F38AAA58E5B) +--- +--- @hash [0x33EE6E2B](https://docs.fivem.net/natives/?_0x33EE6E2B) +--- @param vehicle Vehicle +--- @return number +--- @overload fun(vehicle: Vehicle): number +function GetHeliRearRotorHealth(vehicle) end + + --- SetConvar --- --- @hash [0x341B16D2](https://docs.fivem.net/natives/?_0x341B16D2) @@ -225,6 +288,15 @@ function SetConvar(varName, value) end function SetResourceKvpFloatNoSync(key, value) end +--- GetIsHeliEngineRunning +--- +--- @hash [0x3EFE38D1](https://docs.fivem.net/natives/?_0x3EFE38D1) +--- @param heli Vehicle +--- @return boolean +--- @overload fun(heli: Vehicle): boolean +function GetIsHeliEngineRunning(heli) end + + --- Nonsynchronous [DELETE_RESOURCE_KVP](https://docs.fivem.net/natives/?_0x7389B5DF) operation; see [FLUSH_RESOURCE_KVP](https://docs.fivem.net/natives/?_0x5240DA5A). --- --- @hash [0x4152C90](https://docs.fivem.net/natives/?_0x4152C90) @@ -279,6 +351,33 @@ function DoesBoatSinkWhenWrecked(vehicle) end function GetPedScriptTaskStage(ped) end +--- ```cpp +--- enum EntityOrphanMode { +--- // Default, this will delete the entity when it isn't relevant to any players +--- // NOTE: this *doesn't* mean when they're no longer in scope +--- DeleteWhenNotRelevant = 0, +--- // The entity will be deleted whenever its original owner disconnects +--- // NOTE: if this is set when the entities original owner has already left it will be +--- // marked for deletion (similar to just calling DELETE_ENTITY) +--- DeleteOnOwnerDisconnect = 1, +--- // The entity will never be deleted by the server when it does relevancy checks +--- // you should only use this on entities that need to be relatively persistent +--- KeepEntity = 2 +--- } +--- ``` +--- +--- Sets what happens when the entity is orphaned and no longer has its original owner. +--- +--- **NOTE**: This native doesn't guarantee the persistence of the entity. +--- +--- @hash [0x489E9162](https://docs.fivem.net/natives/?_0x489E9162) +--- @param entity Entity +--- @param orphanMode number (int) +--- @return void +--- @overload fun(entity: Entity, orphanMode: number): void +function SetEntityOrphanMode(entity, orphanMode) end + + --- GetTrainCarriageIndex --- --- @hash [0x4B8285CF](https://docs.fivem.net/natives/?_0x4B8285CF) @@ -407,6 +506,48 @@ function GetNumPlayerIndices() end function SetPlayerRoutingBucket(playerSrc, bucket) end +--- Gets the current time online for a specified player. +--- @usage local function ShowTimeOnline() +--- local player = source +--- local secondsTotalOnline = GetPlayerTimeOnline(player) +--- +--- print(("Time online : %f H %f min %f"):format( +--- (secondsTotalOnline / 3600), +--- ((secondsTotalOnline / 60) % 60), +--- (secondsTotalOnline % 60) +--- )) +--- end +--- +--- RegisterNetEvent("myTimeOnline", ShowTimeOnline +--- @hash [0x67D2E605](https://docs.fivem.net/natives/?_0x67D2E605) +--- @param playerSrc string (char*) +--- @return number +--- @overload fun(playerSrc: string): number +function GetPlayerTimeOnline(playerSrc) end + + +--- Getter to check if one of the neon lights of a vehicle is enabled. This native is the server side getter of [IS_VEHICLE_NEON_LIGHT_ENABLED](https://docs.fivem.net/natives/?_0x8C4B92553E4766A5). +--- +--- ```cpp +--- enum neonIndex +--- { +--- NEON_BACK = 0, // Back neon +--- NEON_RIGHT = 1, // Right neon +--- NEON_LEFT = 2, // Left neon +--- NEON_FRONT = 3 // Front neon +--- }; +--- ``` +--- @usage local vehicle = GetVehiclePedIsIn(GetPlayerPed(1), false) -- 1 is the source here +--- local isRightNeonOn = GetVehicleNeonEnabled(vehicle, 1) +--- print(isRightNeonOn +--- @hash [0x684BDBF2](https://docs.fivem.net/natives/?_0x684BDBF2) +--- @param vehicle Vehicle +--- @param neonIndex number (int) +--- @return boolean +--- @overload fun(vehicle: Vehicle, neonIndex: number): boolean +function GetVehicleNeonEnabled(vehicle, neonIndex) end + + --- Returns all object handles known to the server. --- The data returned adheres to the following layout: --- @@ -523,6 +664,15 @@ function GetPedSpecificTaskType(ped, index) end function GetPlayerMaxHealth(playerSrc) end +--- This is a getter for [SET_DISABLE_HELI_EXPLODE_FROM_BODY_DAMAGE](https://docs.fivem.net/natives/?_0xEDBC8405B3895CC9) +--- +--- @hash [0x82AFC0A3](https://docs.fivem.net/natives/?_0x82AFC0A3) +--- @param heli Vehicle +--- @return boolean +--- @overload fun(heli: Vehicle): boolean +function GetHeliDisableExplodeFromBodyDamage(heli) end + + --- Gets the script task command currently assigned to the ped. --- --- @hash [0x84FE084](https://docs.fivem.net/natives/?_0x84FE084) @@ -559,6 +709,15 @@ function IsPlayerEvadingWantedLevel(playerSrc) end function SetPlayerCullingRadius(playerSrc, radius) end +--- GetHeliThrottleControl +--- +--- @hash [0x8E86238D](https://docs.fivem.net/natives/?_0x8E86238D) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliThrottleControl(heli) end + + --- PerformHttpRequestInternal --- --- @hash [0x8E8CC653](https://docs.fivem.net/natives/?_0x8E8CC653) @@ -569,6 +728,15 @@ function SetPlayerCullingRadius(playerSrc, radius) end function PerformHttpRequestInternal(requestData, requestDataLength) end +--- GetHeliYawControl +--- +--- @hash [0x8FDC0768](https://docs.fivem.net/natives/?_0x8FDC0768) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliYawControl(heli) end + + --- IsBoatWrecked --- --- @hash [0x9049DB44](https://docs.fivem.net/natives/?_0x9049DB44) @@ -598,6 +766,15 @@ function PrintStructuredTrace(jsonString) end function SetConvarServerInfo(varName, value) end +--- GetThrusterThrottle +--- +--- @hash [0x94E24C96](https://docs.fivem.net/natives/?_0x94E24C96) +--- @param jetpack Vehicle +--- @return number +--- @overload fun(jetpack: Vehicle): number +function GetThrusterThrottle(jetpack) end + + --- GetTrainCarriageEngine --- --- @hash [0x95070FA](https://docs.fivem.net/natives/?_0x95070FA) @@ -690,6 +867,15 @@ function GetVehicleDashboardColour(vehicle, color) end function SetRoutingBucketEntityLockdownMode(bucketId, mode) end +--- **Note** This native will always return `1000.0` unless [SET_VEHICLE_BODY_HEALTH](https://docs.fivem.net/natives/?_0xB77D05AC8C78AADB), [SET_VEHICLE_ENGINE_HEALTH](https://docs.fivem.net/natives/?_0x45F6D8EEF34ABEF1), or [SET_VEHICLE_PETROL_TANK_HEALTH](https://docs.fivem.net/natives/?_0x70DB57649FA8D0D8) have been called with a value greater than `1000.0`. +--- +--- @hash [0xA0FA0354](https://docs.fivem.net/natives/?_0xA0FA0354) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliEngineHealth(heli) end + + --- Get an identifier from a player by the type of the identifier. --- @usage local playerLicenses = {} --- @@ -704,6 +890,15 @@ function SetRoutingBucketEntityLockdownMode(bucketId, mode) end function GetPlayerIdentifierByType(playerSrc, identifierType) end +--- **Note** This native will always return `1000.0` unless [SET_VEHICLE_BODY_HEALTH](https://docs.fivem.net/natives/?_0xB77D05AC8C78AADB), [SET_VEHICLE_ENGINE_HEALTH](https://docs.fivem.net/natives/?_0x45F6D8EEF34ABEF1), or [SET_VEHICLE_PETROL_TANK_HEALTH](https://docs.fivem.net/natives/?_0x70DB57649FA8D0D8) have been called with a value greater than `1000.0`. +--- +--- @hash [0xA886495D](https://docs.fivem.net/natives/?_0xA886495D) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliBodyHealth(heli) end + + --- Requests the commerce data for the specified player, including the owned SKUs. Use `IS_PLAYER_COMMERCE_INFO_LOADED` to check if it has loaded. --- --- @hash [0xA8F63EAB](https://docs.fivem.net/natives/?_0xA8F63EAB) @@ -728,7 +923,17 @@ function SetMapName(mapName) end --- ``` --- [127, 42, 13, 37] --- ``` ---- +--- @usage -- This example prints information of every ped that has an owner. +--- +--- for i, ped in ipairs(GetAllPeds()) do +--- local pedOwner = NetworkGetEntityOwner(ped) +--- if pedOwner > 0 then +--- local playerName = GetPlayerName(pedOwner) +--- local pedModel = GetEntityModel(ped) +--- local pedArmour = GetPedArmour(ped) +--- print("Ped : "..ped.." | Owner name : "..playerName.." | Model : "..pedModel.." | Armour : "..pedArmour) +--- end +--- en --- @hash [0xB8584FEF](https://docs.fivem.net/natives/?_0xB8584FEF) --- --- @return Ped[] @@ -782,6 +987,24 @@ function IsPlayerCommerceInfoLoaded(playerSrc) end function GetPedDesiredHeading(ped) end +--- GetHeliMainRotorDamageScale +--- +--- @hash [0xC37D668](https://docs.fivem.net/natives/?_0xC37D668) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliMainRotorDamageScale(heli) end + + +--- GetHeliRearRotorDamageScale +--- +--- @hash [0xC40161E2](https://docs.fivem.net/natives/?_0xC40161E2) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliRearRotorDamageScale(heli) end + + --- IsPlayerUsingSuperJump --- --- @hash [0xC7D2C20C](https://docs.fivem.net/natives/?_0xC7D2C20C) @@ -840,6 +1063,15 @@ function SetRoutingBucketPopulationEnabled(bucketId, mode) end function SetResourceKvpNoSync(key, value) end +--- GetEntityOrphanMode +--- +--- @hash [0xD16EA02F](https://docs.fivem.net/natives/?_0xD16EA02F) +--- @param entity Entity +--- @return number +--- @overload fun(entity: Entity): number +function GetEntityOrphanMode(entity) end + + --- It overrides the default distance culling radius of an entity. Set to `0.0` to reset. --- If you want to interact with an entity outside of your players' scopes set the radius to a huge number. --- @@ -853,6 +1085,15 @@ function SetResourceKvpNoSync(key, value) end function SetEntityDistanceCullingRadius(entity, radius) end +--- **Note** This native will always return `1000.0` unless [SET_VEHICLE_BODY_HEALTH](https://docs.fivem.net/natives/?_0xB77D05AC8C78AADB), [SET_VEHICLE_ENGINE_HEALTH](https://docs.fivem.net/natives/?_0x45F6D8EEF34ABEF1), or [SET_VEHICLE_PETROL_TANK_HEALTH](https://docs.fivem.net/natives/?_0x70DB57649FA8D0D8) have been called with a value greater than `1000.0`. +--- +--- @hash [0xD4EC7858](https://docs.fivem.net/natives/?_0xD4EC7858) +--- @param heli Vehicle +--- @return number +--- @overload fun(heli: Vehicle): number +function GetHeliGasTankHealth(heli) end + + --- IsBoatAnchoredAndFrozen --- --- @hash [0xD5C39EE6](https://docs.fivem.net/natives/?_0xD5C39EE6) @@ -871,6 +1112,37 @@ function IsBoatAnchoredAndFrozen(vehicle) end function GetVehicleHeadlightsColour(vehicle) end +--- Getter to check the neon colour of a vehicle. This native is the server side getter of [GET_VEHICLE_NEON_LIGHTS_COLOUR](https://docs.fivem.net/natives/?_0x7619EEE8C886757F). +--- @usage local vehicle = GetVehiclePedIsIn(GetPlayerPed(1), false) -- 1 is the source here +--- local red, green, blue = GetVehicleNeonColour(vehicle) +--- print(red, green, blue +--- @hash [0xD9319DCB](https://docs.fivem.net/natives/?_0xD9319DCB) +--- @param vehicle Vehicle +--- @return number, number, number +--- @overload fun(vehicle: Vehicle): number, number, number +function GetVehicleNeonColour(vehicle) end + + +--- This is a getter for the client-side native [`START_VEHICLE_HORN`](https://docs.fivem.net/natives/?\_0x9C8C6504B5B63D2C), which allows you to return the horn type of the vehicle. +--- +--- **Note**: This native only gets the hash value set with `START_VEHICLE_HORN`. If a wrong hash is passed into `START_VEHICLE_HORN`, it will return this wrong hash. +--- +--- ```cpp +--- enum eHornTypes +--- { +--- NORMAL = 1330140148, +--- HELDDOWN = -2087385909, +--- AGGRESSIVE = -92810745 +--- } +--- ``` +--- +--- @hash [0xDEA49773](https://docs.fivem.net/natives/?_0xDEA49773) +--- @param vehicle Vehicle +--- @return Hash +--- @overload fun(vehicle: Vehicle): Hash +function GetVehicleHornType(vehicle) end + + --- IsPlayerAceAllowed --- --- @hash [0xDEDAE23D](https://docs.fivem.net/natives/?_0xDEDAE23D) diff --git a/docs-gen/shared-cfx.def.lua b/docs-gen/shared-cfx.def.lua index 70f77e5..a133f9b 100644 --- a/docs-gen/shared-cfx.def.lua +++ b/docs-gen/shared-cfx.def.lua @@ -1,4 +1,14 @@ +--- StateBagHasKey +--- +--- @hash [0x12A330](https://docs.fivem.net/natives/?_0x12A330) +--- @param bagName string (char*) +--- @param key string (char*) +--- @return boolean +--- @overload fun(bagName: string, key: string): boolean +function StateBagHasKey(bagName, key) end + + --- GetVehicleSteeringAngle --- --- @hash [0x1382FCEA](https://docs.fivem.net/natives/?_0x1382FCEA) @@ -36,6 +46,36 @@ function SetResourceKvp(key, value) end function GetPlayerWeaponDamageModifier(playerId) end +--- Returns a list of entity handles (script GUID) for all entities in the specified pool - the data returned is an array as +--- follows: +--- +--- ```json +--- [ 770, 1026, 1282, 1538, 1794, 2050, 2306, 2562, 2818, 3074, 3330, 3586, 3842, 4098, 4354, 4610, ...] +--- ``` +--- +--- ### Supported pools +--- +--- * `CPed`: Peds (including animals) and players. +--- * `CObject`: Objects (props), doors, and projectiles. +--- * `CNetObject`: Networked objects +--- * `CVehicle`: Vehicles. +--- * `CPickup`: Pickups. +--- @usage local vehiclePool = GetGamePool('CVehicle') -- Get the list of vehicles (entities) from the pool +--- for i = 1, #vehiclePool do -- loop through each vehicle (entity) +--- if GetPedInVehicleSeat(vehiclePool[i], -1) == 0 then +--- DeleteEntity(vehiclePool[i]) -- Delete vehicles (entities) that don't have a driver +--- end +--- en +--- @hash [0x2B9D4F50](https://docs.fivem.net/natives/?_0x2B9D4F50) +--- @param poolName string (char*) +--- @return (Ped|Object|Vehicle|Pickup)[] +--- @overload fun(poolname: 'CPed'): Ped[] +--- @overload fun(poolname: 'CObject'): Object[] +--- @overload fun(poolname: 'CVehicle'): Vehicle[] +--- @overload fun(poolname: 'CPickup'): Pickup[] +function GetGamePool(poolName) end + + --- A getter for [SET_RESOURCE_KVP_FLOAT](https://docs.fivem.net/natives/?_0x9ADD2938). --- @usage local kvpValue = GetResourceKvpFloat('mollis') --- if kvpValue ~= 0.0 then @@ -105,7 +145,7 @@ function GetVehicleHandbrake(vehicle) end --- @usage AddStateBagChangeHandler("blockTasks", nil, function(bagName, key, value) --- local entity = GetEntityFromStateBagName(bagName) --- -- Whoops, we don't have a valid entity! ---- if entity === 0 then return end +--- if entity == 0 then return end --- -- We don't want to freeze the entity position if the entity collision hasn't loaded yet --- while not HasCollisionLoadedAroundEntity(entity) do --- -- The entity went out of our scope before the collision loaded @@ -205,7 +245,7 @@ function WasEventCanceled() end --- @usage AddStateBagChangeHandler("blockTasks", nil, function(bagName, key, value) --- local entity = GetEntityFromStateBagName(bagName) --- -- Whoops, we don't have a valid entity! ---- if entity === 0 then return end +--- if entity == 0 then return end --- -- We don't want to freeze the entity position if the entity collision hasn't loaded yet --- while not HasCollisionLoadedAroundEntity(entity) do --- -- The entity went out of our scope before the collision loaded @@ -328,6 +368,27 @@ function LoadResourceFile(resourceName, fileName) end function GetNumResourceMetadata(resourceName, metadataKey) end +--- GetStateBagKeys +--- +--- @hash [0x78D864C7](https://docs.fivem.net/natives/?_0x78D864C7) +--- @param bagName string (char*) +--- @return table +--- @overload fun(bagName: string): table +function GetStateBagKeys(bagName) end + + +--- Can be used to get a console variable casted back to `bool`. +--- @usage if GetConvarBool('dev_mode', false) then +--- print("Dev Mode is eanbled, load dev mode menus") +--- en +--- @hash [0x7E8EBFE5](https://docs.fivem.net/natives/?_0x7E8EBFE5) +--- @param varName string (char*) +--- @param defaultValue boolean +--- @return boolean +--- @overload fun(varName: string, defaultValue: boolean): boolean +function GetConvarBool(varName, defaultValue) end + + --- IsAceAllowed --- --- @hash [0x7EBB9929](https://docs.fivem.net/natives/?_0x7EBB9929) @@ -352,6 +413,8 @@ function IsAceAllowed(object) end --- * 2802 --- * 2944 --- * 3095 +--- * 3258 +--- * 3323 --- * RedM --- * 1311 --- * 1355 @@ -455,6 +518,16 @@ function GetPlayerWeaponDefenseModifier_2(playerId) end function SetResourceKvpFloat(key, value) end +--- This will have floating point inaccuracy. +--- +--- @hash [0x9E666D](https://docs.fivem.net/natives/?_0x9E666D) +--- @param varName string (char*) +--- @param defaultValue number (float) +--- @return number +--- @overload fun(varName: string, defaultValue: number): number +function GetConvarFloat(varName, defaultValue) end + + --- GetInstanceId --- --- @hash [0x9F1C4383](https://docs.fivem.net/natives/?_0x9F1C4383) @@ -500,6 +573,25 @@ function GetVehicleType(vehicle) end function GetPlayerFromStateBagName(bagName) end +--- Adds a listener for Console Variable changes. +--- +--- The function called expects to match the following signature: +--- +--- ```ts +--- function ConVarChangeListener(conVarName: string, reserved: any); +--- ``` +--- +--- * **conVarName**: The ConVar that changed. +--- * **reserved**: Currently unused. +--- +--- @hash [0xAB7F7241](https://docs.fivem.net/natives/?_0xAB7F7241) +--- @param conVarFilter string (char*) +--- @param handler fun +--- @return number +--- @overload fun(conVarFilter: string, handler: fun): number +function AddConvarChangeListener(conVarFilter, handler) end + + --- EndFindKvp --- --- @hash [0xB3210203](https://docs.fivem.net/natives/?_0xB3210203) @@ -611,9 +703,11 @@ function GetRegisteredCommands() end --- if key then --- print(('%s: %s'):format(key, GetResourceKvpString(key))) --- end ---- until key +--- until not key --- --- EndFindKvp(kvpHandle) +--- else +--- print('No KVPs found') --- en --- @hash [0xDD379006](https://docs.fivem.net/natives/?_0xDD379006) --- @param prefix string (char*) @@ -622,18 +716,6 @@ function GetRegisteredCommands() end function StartFindKvp(prefix) end ---- InvokeFunctionReference ---- ---- @hash [0xE3551879](https://docs.fivem.net/natives/?_0xE3551879) ---- @param referenceIdentity string (char*) ---- @param argsSerialized string (char*) ---- @param argsLength number (int) ---- @param retvalLength number (int*) ---- @return string ---- @overload fun(argsLength: number): string, string): string, string): string, number -function InvokeFunctionReference(referenceIdentity, argsSerialized, argsLength, retvalLength) end - - --- Returns the name of the currently executing resource. --- --- @hash [0xE5E9EBBB](https://docs.fivem.net/natives/?_0xE5E9EBBB) @@ -661,6 +743,15 @@ function GetCurrentResourceName() end function GetGameName() end +--- RemoveConvarChangeListener +--- +--- @hash [0xEAC49841](https://docs.fivem.net/natives/?_0xEAC49841) +--- @param cookie number (int) +--- @return void +--- @overload fun(cookie: number): void +function RemoveConvarChangeListener(cookie) end + + --- A getter for [FREEZE_ENTITY_POSITION](https://docs.fivem.net/natives/?_0x428CA6DBD1094446). --- @usage local isFrozen = IsEntityPositionFrozen(PlayerPedId() --- @hash [0xEDBE6ADD](https://docs.fivem.net/natives/?_0xEDBE6ADD)