diff --git a/CAM/AnimatedShakeCam.md b/CAM/AnimatedShakeCam.md index 24a9b9ffe..eea84b6c6 100644 --- a/CAM/AnimatedShakeCam.md +++ b/CAM/AnimatedShakeCam.md @@ -5,18 +5,35 @@ ns: CAM ```c // 0xA2746EEAE3E577CD 0xE1168767 -void ANIMATED_SHAKE_CAM(Cam cam, char* p1, char* p2, char* p3, float amplitude); +void ANIMATED_SHAKE_CAM(Cam cam, char* animDict, char* animName, char* p3, float amplitude); ``` -``` -Example from michael2 script. -CAM::ANIMATED_SHAKE_CAM(l_5069, "shake_cam_all@", "light", "", 1f); -``` +Makes a camera shake with specific animation dictionary. ## Parameters -* **cam**: -* **p1**: -* **p2**: -* **p3**: -* **amplitude**: +* **cam**: Cam ID +* **animDict**: Animation dictionary of this shake. Must be requested with (REQUEST_ANIM_DICT)(#_0xD3BD40951412FEF6) +* **animName**: Animation name +* **p3**: Unknown. In scripts, only "" is used +* **amplitude**: Strength of the cam shake + +## Examples +```lua +RegisterCommand('viewvinewood', function() + RequestAnimDict('shake_cam_all@') -- Request the shake animation dictionary + + while not HasAnimDictLoaded('shake_cam_all@') do Wait(0) end -- Wait for the dictionary to load + + local camID = CreateCam('DEFAULT_SCRIPTED_CAMERA', true) + SetCamRot(camID, 1.07, 0.0, -26.70, 2) -- Rotate the camera to face the vinewood sign + SetCamCoord(camID, 573.5313, 905.455, 305.432) -- Set the camera location + AnimatedShakeCam(camID, 'shake_cam_all@', 'light', '', 0.5) -- Play the shake animation on the camera + RemoveAnimDict('shake_cam_all@') -- Unload the dictionary + + RenderScriptCams(true, false, 3000, true, false, 0) -- Render the camera + BeginTextCommandDisplayHelp('STRING') + AddTextComponentSubstringPlayerName('You are now looking at the beautiful Vinewood sign.') + EndTextCommandDisplayHelp(0, false, true, -1) +end) +``` \ No newline at end of file diff --git a/CAM/AnimatedShakeScriptGlobal.md b/CAM/AnimatedShakeScriptGlobal.md index cfae4a3d7..7ad52c4fd 100644 --- a/CAM/AnimatedShakeScriptGlobal.md +++ b/CAM/AnimatedShakeScriptGlobal.md @@ -6,16 +6,13 @@ aliases: ["0xC2EAE3FB8CDBED31"] ```c // 0xC2EAE3FB8CDBED31 0xCB75BD9C -void ANIMATED_SHAKE_SCRIPT_GLOBAL(char* p0, char* p1, char* p2, float p3); +void ANIMATED_SHAKE_SCRIPT_GLOBAL(char* animDict, char* animName, char* p2, float amplitude); ``` -``` -CAM::ANIMATED_SHAKE_SCRIPT_GLOBAL("SHAKE_CAM_medium", "medium", "", 0.5f); -``` +Makes every script-created camera shake with a specific anim dictionary. ## Parameters -* **p0**: -* **p1**: -* **p2**: -* **p3**: - +* **animDict**: Anim dictionary to shake the cameras with. Must be requested with (REQUEST_ANIM_DICT)(#_0xD3BD40951412FEF6) +* **animName**: Animation name +* **p2**: Unknown. Only "" is used in scripts. +* **amplitude**: Strength of the shake diff --git a/CAM/IsCamShaking.md b/CAM/IsCamShaking.md index eeca00213..5c39510fc 100644 --- a/CAM/IsCamShaking.md +++ b/CAM/IsCamShaking.md @@ -10,6 +10,7 @@ BOOL IS_CAM_SHAKING(Cam cam); ## Parameters -* **cam**: +* **cam**: Cam ID returned by [CREATE_CAM](#_0xC3981DCE61D9E13F) ## Return value +Whether or not this cam was set to shake with [SHAKE_CAM](#_0x6A25241C340D3822) \ No newline at end of file diff --git a/CAM/IsCinematicCamShaking.md b/CAM/IsCinematicCamShaking.md index 3e59bf70d..818b711b7 100644 --- a/CAM/IsCinematicCamShaking.md +++ b/CAM/IsCinematicCamShaking.md @@ -10,3 +10,4 @@ BOOL IS_CINEMATIC_CAM_SHAKING(); ## Return value +Whether or not the cinematic/idle cam was set to shake with [SHAKE_CINEMATIC_CAM](#_0xDCE214D9ED58F3CF) \ No newline at end of file diff --git a/CAM/IsGameplayCamShaking.md b/CAM/IsGameplayCamShaking.md index 0a22df958..4ba1fbc12 100644 --- a/CAM/IsGameplayCamShaking.md +++ b/CAM/IsGameplayCamShaking.md @@ -10,3 +10,4 @@ BOOL IS_GAMEPLAY_CAM_SHAKING(); ## Return value +Whether or not the gameplay cam was set to shake with [SHAKE_GAMEPLAY_CAM](#_0xFD55E49555E017CF) \ No newline at end of file diff --git a/CAM/IsScriptGlobalShaking.md b/CAM/IsScriptGlobalShaking.md index aa2d363dd..68fa0022e 100644 --- a/CAM/IsScriptGlobalShaking.md +++ b/CAM/IsScriptGlobalShaking.md @@ -9,11 +9,5 @@ aliases: ["0xC912AF078AF19212"] BOOL IS_SCRIPT_GLOBAL_SHAKING(); ``` -``` -In drunk_controller.c4, sub_309 -if (CAM::IS_SCRIPT_GLOBAL_SHAKING()) { - CAM::STOP_SCRIPT_GLOBAL_SHAKING(0); -} -``` - ## Return value +Whether or not every camera has been set to shake with [SCRIPT_GLOBAL_SHAKE](#_0xF4C8CF9E353AFECA) \ No newline at end of file diff --git a/CAM/SetCamDofStrength.md b/CAM/SetCamDofStrength.md index 6736b2ac7..26aa20bd8 100644 --- a/CAM/SetCamDofStrength.md +++ b/CAM/SetCamDofStrength.md @@ -8,8 +8,34 @@ ns: CAM void SET_CAM_DOF_STRENGTH(Cam cam, float dofStrength); ``` +Specifies how much the DoF effect should be applied (Set using [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), etc.) ## Parameters -* **cam**: -* **dofStrength**: +* **cam**: The camera handle +* **dofStrength**: Depth of Field strength (between 0.0 and 1.0) +## Examples +```lua +CreateThread(function() + local camera = CreateCam("DEFAULT_SCRIPTED_FLY_CAMERA", true) + -- Set the cam coordinates to the player coords + local playerCoords = GetEntityCoords(PlayerPedId()) + SetCamCoord(camera, playerCoords) + -- Render the camera we just created + RenderScriptCams(true) + -- Use a shallow depth of field + SetCamUseShallowDofMode(camera, true) + -- Set at what distance your camera should start to focus (Example: 0.7 meters) + SetCamNearDof(camera, 0.7) + -- Set at what distance your camera should stop focusing (Example: 1.3 meters) + SetCamFarDof(camera, 1.3) + -- Apply 100% of the DoF effect (The native you're reading documentation on) + SetCamDofStrength(camera, 1.0) + + while DoesCamExist(camera) do + -- Use DoF effect (needs to be called every tick) + SetUseHiDof() + Citizen.Wait(0) + end +end) +``` diff --git a/CAM/SetCamFarDof.md b/CAM/SetCamFarDof.md index 9024df9b6..92ac86b29 100644 --- a/CAM/SetCamFarDof.md +++ b/CAM/SetCamFarDof.md @@ -8,8 +8,11 @@ ns: CAM void SET_CAM_FAR_DOF(Cam cam, float farDOF); ``` +Specifies when the camera should stop being in focus. Can be used together with [`SET_USE_HI_DOF`](#_0xA13B0222F3D94A94), [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_USE_SHALLOW_DOF_MODE`](#_0x16A96863A17552BB), [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897) and other DoF related natives. -## Parameters -* **cam**: -* **farDOF**: +### Usage Example +A usage example for this native can be found in the following native documentation: [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897). +## Parameters +* **cam**: The camera handle +* **farDOF**: Distance in in standard units diff --git a/CAM/SetCamNearDof.md b/CAM/SetCamNearDof.md index 626ba267d..d294712f8 100644 --- a/CAM/SetCamNearDof.md +++ b/CAM/SetCamNearDof.md @@ -8,8 +8,12 @@ ns: CAM void SET_CAM_NEAR_DOF(Cam cam, float nearDOF); ``` +Specifies when the camera should start being in focus. Can be used together with [`SET_USE_HI_DOF`](#_0xA13B0222F3D94A94), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), [`SET_CAM_USE_SHALLOW_DOF_MODE`](#_0x16A96863A17552BB), [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897) and other DoF related natives. -## Parameters -* **cam**: -* **nearDOF**: +### Usage Example +A usage example for this native can be found in the following native documentation: [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897). + +## Parameters +* **cam**: The camera handle +* **nearDOF**: Distance in in standard units diff --git a/CAM/SetCamUseShallowDofMode.md b/CAM/SetCamUseShallowDofMode.md index 5602e8549..3402cdf6a 100644 --- a/CAM/SetCamUseShallowDofMode.md +++ b/CAM/SetCamUseShallowDofMode.md @@ -8,8 +8,12 @@ ns: CAM void SET_CAM_USE_SHALLOW_DOF_MODE(Cam cam, BOOL toggle); ``` +Enables or disables the usage of a shallow DOF. Needs to be set to true to use [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), etc. Doesn't need to be called every tick. -## Parameters -* **cam**: -* **toggle**: +### Usage Example +A usage example for this native can be found in the following native documentation: [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897). + +## Parameters +* **cam**: The camera handle +* **toggle**: Boolean if the camera should use a shallow depth of field or not diff --git a/CAM/SetUseHiDof.md b/CAM/SetUseHiDof.md index 434ee8381..16817e332 100644 --- a/CAM/SetUseHiDof.md +++ b/CAM/SetUseHiDof.md @@ -8,4 +8,8 @@ ns: CAM void SET_USE_HI_DOF(); ``` +Needs to be called every tick to make the active camera use a high depth of field. +The DoF can be customized using [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), [`SET_CAM_USE_SHALLOW_DOF_MODE`](#_0x16A96863A17552BB), [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897) and other DoF related natives. +### Usage Example +A usage example for this native can be found in the following native documentation: [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897). diff --git a/CAM/ShakeCam.md b/CAM/ShakeCam.md index fd65c4596..67df2f9a9 100644 --- a/CAM/ShakeCam.md +++ b/CAM/ShakeCam.md @@ -8,23 +8,11 @@ ns: CAM void SHAKE_CAM(Cam cam, char* type, float amplitude); ``` -``` -Possible shake types (updated b617d): -DEATH_FAIL_IN_EFFECT_SHAKE -DRUNK_SHAKE -FAMILY5_DRUG_TRIP_SHAKE -HAND_SHAKE -JOLT_SHAKE -LARGE_EXPLOSION_SHAKE -MEDIUM_EXPLOSION_SHAKE -SMALL_EXPLOSION_SHAKE -ROAD_VIBRATION_SHAKE -SKY_DIVING_SHAKE -VIBRATE_SHAKE -``` +Makes a cam shake. +[Shake Type List](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json) ## Parameters -* **cam**: -* **type**: -* **amplitude**: +* **cam**: Cam ID, returned by [CREATE_CAM](#_0xC3981DCE61D9E13F) +* **type**: How the cam should shake +* **amplitude**: Strength of the cam shake diff --git a/CAM/ShakeCinematicCam.md b/CAM/ShakeCinematicCam.md index 3064fe760..f4b505477 100644 --- a/CAM/ShakeCinematicCam.md +++ b/CAM/ShakeCinematicCam.md @@ -5,14 +5,13 @@ ns: CAM ```c // 0xDCE214D9ED58F3CF 0x61815F31 -void SHAKE_CINEMATIC_CAM(char* p0, float p1); +void SHAKE_CINEMATIC_CAM(char* shakeType, float amplitude); ``` -``` -p0 argument found in the b617d scripts: "DRUNK_SHAKE" -``` +Makes the cinematic/idle cam shake. +[Shake Type List](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json) ## Parameters -* **p0**: -* **p1**: +* **shakeType**: How the cinematic cam should shake +* **amplitude**: Float value that represents the strength of the shake diff --git a/CAM/ShakeGameplayCam.md b/CAM/ShakeGameplayCam.md index f1f57a210..d883072ce 100644 --- a/CAM/ShakeGameplayCam.md +++ b/CAM/ShakeGameplayCam.md @@ -5,25 +5,13 @@ ns: CAM ```c // 0xFD55E49555E017CF 0xF2EFE660 -void SHAKE_GAMEPLAY_CAM(char* shakeName, float intensity); +void SHAKE_GAMEPLAY_CAM(char* shakeType, float amplitude); ``` -``` -Possible shake types (updated b617d): -DEATH_FAIL_IN_EFFECT_SHAKE -DRUNK_SHAKE -FAMILY5_DRUG_TRIP_SHAKE -HAND_SHAKE -JOLT_SHAKE -LARGE_EXPLOSION_SHAKE -MEDIUM_EXPLOSION_SHAKE -SMALL_EXPLOSION_SHAKE -ROAD_VIBRATION_SHAKE -SKY_DIVING_SHAKE -VIBRATE_SHAKE -``` +Makes the gameplay cam shake. +[Shake Type List](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json) ## Parameters -* **shakeName**: -* **intensity**: +* **shakeType**: How the gameplay cam should shake +* **amplitude**: Float value that represents the strength of the shake diff --git a/CAM/ShakeScriptGlobal.md b/CAM/ShakeScriptGlobal.md index 3e75be624..03fc020bb 100644 --- a/CAM/ShakeScriptGlobal.md +++ b/CAM/ShakeScriptGlobal.md @@ -6,14 +6,13 @@ aliases: ["0xF4C8CF9E353AFECA"] ```c // 0xF4C8CF9E353AFECA 0x2B0F05CD -void SHAKE_SCRIPT_GLOBAL(char* p0, float p1); +void SHAKE_SCRIPT_GLOBAL(char* shakeType, float amplitude); ``` -``` -CAM::SHAKE_SCRIPT_GLOBAL("HAND_SHAKE", 0.2); -``` +Makes every script-created camera shake. +[Shake Type List](https://github.com/DurtyFree/gta-v-data-dumps/blob/master/camShakeTypesCompact.json) ## Parameters -* **p0**: -* **p1**: +* **shakeType**: How the cameras should shake +* **amplitude**: Float value that represents the strength of the shake diff --git a/CAM/StopCamShaking.md b/CAM/StopCamShaking.md index 164384a4b..824c24f67 100644 --- a/CAM/StopCamShaking.md +++ b/CAM/StopCamShaking.md @@ -5,11 +5,11 @@ ns: CAM ```c // 0xBDECF64367884AC3 0x40D0EB87 -void STOP_CAM_SHAKING(Cam cam, BOOL p1); +void STOP_CAM_SHAKING(Cam cam, BOOL instantly); ``` ## Parameters -* **cam**: -* **p1**: +* **cam**: Cam ID +* **instantly**: If false, the camera will transition into normal state. If true, the camera will stop shaking instantly. diff --git a/CAM/StopCinematicCamShaking.md b/CAM/StopCinematicCamShaking.md index 2ea0b9ed8..b27459133 100644 --- a/CAM/StopCinematicCamShaking.md +++ b/CAM/StopCinematicCamShaking.md @@ -5,10 +5,10 @@ ns: CAM ```c // 0x2238E588E588A6D7 0x71C12904 -void STOP_CINEMATIC_CAM_SHAKING(BOOL p0); +void STOP_CINEMATIC_CAM_SHAKING(BOOL instantly); ``` ## Parameters -* **p0**: +* **instantly**: If false, the cinematic/idle camera will transition into normal state. If true, the camera will stop shaking instantly. diff --git a/CAM/StopGameplayCamShaking.md b/CAM/StopGameplayCamShaking.md index 2dc883715..b06f0d9fd 100644 --- a/CAM/StopGameplayCamShaking.md +++ b/CAM/StopGameplayCamShaking.md @@ -5,10 +5,10 @@ ns: CAM ```c // 0x0EF93E9F3D08C178 0xFD569E4E -void STOP_GAMEPLAY_CAM_SHAKING(BOOL p0); +void STOP_GAMEPLAY_CAM_SHAKING(BOOL instantly); ``` ## Parameters -* **p0**: +* **instantly**: If false, the gameplay camera will transition into normal state. If true, the camera will stop shaking instantly. diff --git a/CAM/StopScriptGlobalShaking.md b/CAM/StopScriptGlobalShaking.md index efbf65753..8fe53b4b6 100644 --- a/CAM/StopScriptGlobalShaking.md +++ b/CAM/StopScriptGlobalShaking.md @@ -6,16 +6,11 @@ aliases: ["0x1C9D7949FA533490"] ```c // 0x1C9D7949FA533490 0x26FCFB96 -void STOP_SCRIPT_GLOBAL_SHAKING(BOOL p0); +void STOP_SCRIPT_GLOBAL_SHAKING(BOOL instantly); ``` -``` -In drunk_controller.c4, sub_309 -if (CAM::IS_SCRIPT_GLOBAL_SHAKING()) { - CAM::STOP_SCRIPT_GLOBAL_SHAKING(0); -} -``` +Stops shaking script-created cameras. ## Parameters -* **p0**: +* **instantly**: If false, currently rendering camera will transition into normal state. If true, the cameras will stop shaking instantly. diff --git a/ENTITY/DeleteEntity.md b/ENTITY/DeleteEntity.md index 6e8fcbfc9..7a9d5d89e 100644 --- a/ENTITY/DeleteEntity.md +++ b/ENTITY/DeleteEntity.md @@ -9,7 +9,54 @@ ns: ENTITY void DELETE_ENTITY(Entity* entity); ``` -Deletes the specified entity, and invalidates the passed handle (i.e. in/out argument). +Delete the specified entity, and invalidate the passed handle (i.e., the in/out argument). +You might want to check if the entity exists before with [DOES_ENTITY_EXIST](#_0x7239B21A38F536BA). ## Parameters - **entity**: The entity to delete. + +## Examples +```lua +-- Retrieve the vehicle the player is currently in. +local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) + +-- Check if the vehicle exists in the game world. +if not DoesEntityExist(vehicle) then + -- If the vehicle does not exist, end the execution of the code here. + return +end + +-- If the vehicle does exist, delete the vehicle entity from the game world. +DeleteEntity(vehicle) +``` + +```js +// Retrieve the vehicle the player is currently in. +const vehicle = GetVehiclePedIsIn(PlayerPedId(), false); + +// Check if the vehicle exists in the game world. +if (!DoesEntityExist(vehicle)) { + // If the vehicle does not exist, end the execution of the code here. + return; +} + +// If the vehicle does exist, delete the vehicle entity from the game world. +DeleteEntity(vehicle); +``` + +```cs +using static CitizenFX.Core.Native.API; + +// Retrieve the vehicle the player is currently in. +Vehicle vehicle = GetVehiclePedIsIn(PlayerPedId(), false); + +// Check if the vehicle exists in the game world. +if (!DoesEntityExist(vehicle)) +{ + // If the vehicle does not exist, end the execution of the code here. + return; +} + +// If the vehicle does exist, delete the vehicle entity from the game world. +DeleteEntity(vehicle); +``` \ No newline at end of file diff --git a/HUD/DisableFrontendThisFrame.md b/HUD/DisableFrontendThisFrame.md index 45394ae91..1b27ca77e 100644 --- a/HUD/DisableFrontendThisFrame.md +++ b/HUD/DisableFrontendThisFrame.md @@ -8,4 +8,4 @@ ns: HUD void DISABLE_FRONTEND_THIS_FRAME(); ``` - +Prevents pause menu from listening to controls 199, 200 every frame. diff --git a/HUD/GetMenuLayoutChangedEventDetails.md b/HUD/GetMenuLayoutChangedEventDetails.md new file mode 100644 index 000000000..e94b47daf --- /dev/null +++ b/HUD/GetMenuLayoutChangedEventDetails.md @@ -0,0 +1,34 @@ +--- +ns: HUD +aliases: ["0x7E17BE53E1AAABAF", "_GET_PAUSE_MENU_SELECTION_DATA"] +--- +## GET_MENU_LAYOUT_CHANGED_EVENT_DETAILS + +```c +// 0x7E17BE53E1AAABAF 0x6025AA2F +void GET_MENU_LAYOUT_CHANGED_EVENT_DETAILS(int* oldMenuState, int* currentMenuState, int* selectedItemUniqueId); +``` + +Returns details of the current layout changed event. Also see [`HAS_MENU_LAYOUT_CHANGE_EVENT_OCCURED`](#_0x2E22FEFA0100275E). +Menu state values can be viewed in [PauseMenuLUT.as](https://gist.github.com/freedy69/19c4be9699e07946285f9b51799b67a9) in scaleform files. + +when the pausemenu is closed: +oldMenuState = -1 +currentMenuState = -1 +selectedItemUniqueId = 0 + +when the header gains focus: +oldMenuState updates as normal or 0 if the pausemenu was just opened +currentMenuState becomes a unique id for the pausemenu page that focus was taken from (?) or 0 if the pausemenu was just opened +selectedItemUniqueId = -1 + +when focus is moved from the header to a pausemenu page: +oldMenuState becomes a unique id for the pausemenu page that focus was moved to (?) +currentMenuState = -1 +selectedItemUniqueId updates as normal + +## Parameters +* **oldMenuState**: This is the menuID of the last selected item minus 1000 (lastItem.menuID - 1000) +* **currentMenuState**: Same as oldMenuState except for the currently selected menu item +* **selectedItemUniqueId**: This is uniqueID of the currently selected menu item + diff --git a/HUD/GetMenuTriggerEventDetails.md b/HUD/GetMenuTriggerEventDetails.md new file mode 100644 index 000000000..cf0a509f8 --- /dev/null +++ b/HUD/GetMenuTriggerEventDetails.md @@ -0,0 +1,18 @@ +--- +ns: HUD +aliases: ["0x36C1451A88A09630", "_GET_PAUSE_MENU_SELECTION"] +--- +## GET_MENU_TRIGGER_EVENT_DETAILS + +```c +// 0x36C1451A88A09630 0x8543AAC8 +void GET_MENU_TRIGGER_EVENT_DETAILS(cs_type(AnyPtr) int* lastItemMenuId, cs_type(AnyPtr) int* selectedItemUniqueId); +``` + +Returns details of the currently occurred trigger event. +See [`HAS_MENU_TRIGGER_EVENT_OCCURRED`](#_0xF284AC67940C6812). + +## Parameters +* **lastItemMenuId**: +* **selectedItemUniqueId**: + diff --git a/HUD/GetScaleformMovieCursorSelection.md b/HUD/GetMouseEvent.md similarity index 82% rename from HUD/GetScaleformMovieCursorSelection.md rename to HUD/GetMouseEvent.md index eec158e5b..a57ef25b9 100644 --- a/HUD/GetScaleformMovieCursorSelection.md +++ b/HUD/GetMouseEvent.md @@ -1,15 +1,16 @@ --- ns: HUD -aliases: ["0x632B2940C67F4EA9"] +aliases: ["0x632B2940C67F4EA9", "_GET_SCALEFORM_MOVIE_CURSOR_SELECTION"] --- -## _GET_SCALEFORM_MOVIE_CURSOR_SELECTION +## GET_MOUSE_EVENT ```c // 0x632B2940C67F4EA9 -BOOL _GET_SCALEFORM_MOVIE_CURSOR_SELECTION(int scaleformHandle, cs_type(Any*) bool* received, cs_type(Any*) int* selectionType, cs_type(Any*) int* context, int* slotIndex); +BOOL GET_MOUSE_EVENT(int scaleformHandle, cs_type(Any*) bool* received, cs_type(Any*) int* selectionType, cs_type(Any*) int* context, int* slotIndex); ``` -Gets mouse selection data from scaleforms with mouse support. Must be checked every frame. +Gets the current mouse event details when triggered by a scaleform. +You must use this native every frame. Returns item index if using the COLOUR_SWITCHER_02 scaleform. Selection types, found in MOUSE_EVENTS.as: MOUSE_DRAG_OUT = 0; diff --git a/HUD/GetPauseMenuCursorPosition.md b/HUD/GetPauseMenuCursorPosition.md deleted file mode 100644 index 7372f48db..000000000 --- a/HUD/GetPauseMenuCursorPosition.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -ns: HUD -aliases: ['0x5BFF36D6ED83E0AE'] ---- -## _GET_PAUSE_MENU_CURSOR_POSITION - -```c -// 0x5BFF36D6ED83E0AE -Vector3 _GET_PAUSE_MENU_CURSOR_POSITION(); -``` - -Name between `GET_ONSCREEN_KEYBOARD_RESULT` and `GET_PAUSE_MENU_STATE`. Likely, `GET_PAUSE_MENU_*`. - - -## Return value -If the pause menu is open, it will return a Vector3, Z is always 0. -If the pause menu is closed, it will return Vector3.Zero diff --git a/HUD/GetPauseMenuPosition.md b/HUD/GetPauseMenuPosition.md new file mode 100644 index 000000000..7df911549 --- /dev/null +++ b/HUD/GetPauseMenuPosition.md @@ -0,0 +1,15 @@ +--- +ns: HUD +aliases: ['0x5BFF36D6ED83E0AE', "_GET_PAUSE_MENU_CURSOR_POSITION"] +--- +## GET_PAUSE_MENU_POSITION + +```c +// 0x5BFF36D6ED83E0AE +Vector3 GET_PAUSE_MENU_POSITION(); +``` + + +## Return value +This is used as a vector2, so Z is always 0. +Returns starting position coordinates of the Pause Menu's body component. diff --git a/HUD/GetPauseMenuSelection.md b/HUD/GetPauseMenuSelection.md deleted file mode 100644 index 055612e61..000000000 --- a/HUD/GetPauseMenuSelection.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -ns: HUD -aliases: ["0x36C1451A88A09630"] ---- -## _GET_PAUSE_MENU_SELECTION - -```c -// 0x36C1451A88A09630 0x8543AAC8 -void _GET_PAUSE_MENU_SELECTION(cs_type(AnyPtr) int* lastItemMenuId, cs_type(AnyPtr) int* selectedItemUniqueId); -``` - -## Parameters -* **lastItemMenuId**: -* **selectedItemUniqueId**: - diff --git a/HUD/GetPauseMenuSelectionData.md b/HUD/GetPauseMenuSelectionData.md deleted file mode 100644 index dad2bd110..000000000 --- a/HUD/GetPauseMenuSelectionData.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -ns: HUD -aliases: ["0x7E17BE53E1AAABAF"] ---- -## _GET_PAUSE_MENU_SELECTION_DATA - -```c -// 0x7E17BE53E1AAABAF 0x6025AA2F -void _GET_PAUSE_MENU_SELECTION_DATA(int* lastItemMenuId, int* selectedItemMenuId, int* selectedItemUniqueId); -``` - -``` -lastItemMenuId: this is the menuID of the last selected item minus 1000 (lastItem.menuID - 1000) -selectedItemMenuId: same as lastItemMenuId except for the currently selected menu item -selectedItemUniqueId: this is uniqueID of the currently selected menu item -when the pausemenu is closed: -lastItemMenuId = -1 -selectedItemMenuId = -1 -selectedItemUniqueId = 0 -when the header gains focus: -lastItemMenuId updates as normal or 0 if the pausemenu was just opened -selectedItemMenuId becomes a unique id for the pausemenu page that focus was taken from (?) or 0 if the pausemenu was just opened -selectedItemUniqueId = -1 -when focus is moved from the header to a pausemenu page: -lastItemMenuId becomes a unique id for the pausemenu page that focus was moved to (?) -selectedItemMenuId = -1 -selectedItemUniqueId updates as normal -``` - -## Parameters -* **lastItemMenuId**: -* **selectedItemMenuId**: -* **selectedItemUniqueId**: - diff --git a/HUD/GetPauseMenuState.md b/HUD/GetPauseMenuState.md index 4ca012f22..afd4900bd 100644 --- a/HUD/GetPauseMenuState.md +++ b/HUD/GetPauseMenuState.md @@ -8,16 +8,11 @@ ns: HUD int GET_PAUSE_MENU_STATE(); ``` -``` -Returns: -0 -5 -10 -15 -20 -25 -30 -35 -``` - ## Return value +0 - Pause menu isn't open +5 - Pause menu is starting +10 - Pause menu is switching +15 - Pause menu is ready for control +25 - Social club menu or online policies menu is open +30 - Pause menu is exiting +35 - Rockstar editor is active \ No newline at end of file diff --git a/HUD/HasMenuLayoutChangedEventOccurred.md b/HUD/HasMenuLayoutChangedEventOccurred.md new file mode 100644 index 000000000..2a5557942 --- /dev/null +++ b/HUD/HasMenuLayoutChangedEventOccurred.md @@ -0,0 +1,14 @@ +--- +ns: HUD +aliases: ["0x2E22FEFA0100275E"] +--- +## HAS_MENU_LAYOUT_CHANGED_EVENT_OCCURRED + +```c +// 0x2E22FEFA0100275E 0x96863460 +BOOL HAS_MENU_LAYOUT_CHANGED_EVENT_OCCURRED(); +``` + +## Return value +Returns true per frame when pause menu is navigated. +Note: This can only be used by one script at a time. \ No newline at end of file diff --git a/HUD/HasMenuTriggerEventOccurred.md b/HUD/HasMenuTriggerEventOccurred.md new file mode 100644 index 000000000..292adbd75 --- /dev/null +++ b/HUD/HasMenuTriggerEventOccurred.md @@ -0,0 +1,14 @@ +--- +ns: HUD +aliases: ["0xF284AC67940C6812"] +--- +## HAS_MENU_TRIGGER_EVENT_OCCURRED + +```c +// 0xF284AC67940C6812 0x7D95AFFF +cs_type(Any) BOOL HAS_MENU_TRIGGER_EVENT_OCCURRED(); +``` + +## Return value +Returns true if a pause menu Trigger Event has occured this frame. +Trigger event becomes active whenever currently highlighted menu item in pause menu is either clicked on by the cursor or enter (control 201) is pressed. \ No newline at end of file diff --git a/HUD/IsMouseCursorAboveInstructionalButtons.md b/HUD/IsMouseCursorAboveInstructionalButtons.md deleted file mode 100644 index 99aeb25a6..000000000 --- a/HUD/IsMouseCursorAboveInstructionalButtons.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -ns: HUD -aliases: ["0x3D9ACB1EB139E702"] ---- -## _IS_MOUSE_CURSOR_ABOVE_INSTRUCTIONAL_BUTTONS - -```c -// 0x3D9ACB1EB139E702 -cs_type(Any) BOOL _IS_MOUSE_CURSOR_ABOVE_INSTRUCTIONAL_BUTTONS(); -``` - -Returns true if the cursor is hovering above instructional buttons. -Note: The buttons need to support mouse (with the TOGGLE_MOUSE_SUPPORT scaleform movie method) for it to return true. - -## Return value diff --git a/HUD/IsMouseRolledOverInstructionalButtons.md b/HUD/IsMouseRolledOverInstructionalButtons.md new file mode 100644 index 000000000..f6d43e71e --- /dev/null +++ b/HUD/IsMouseRolledOverInstructionalButtons.md @@ -0,0 +1,14 @@ +--- +ns: HUD +aliases: ["0x3D9ACB1EB139E702", "_IS_MOUSE_CURSOR_ABOVE_INSTRUCTIONAL_BUTTONS"] +--- +## IS_MOUSE_ROLLED_OVER_INSTRUCTIONAL_BUTTONS + +```c +// 0x3D9ACB1EB139E702 +cs_type(Any) BOOL IS_MOUSE_ROLLED_OVER_INSTRUCTIONAL_BUTTONS(); +``` + +## Return value +Returns true if the cursor is hovering above instructional buttons. +Note: The buttons need to support mouse (with the TOGGLE_MOUSE_SUPPORT scaleform movie method) for it to return true. \ No newline at end of file diff --git a/HUD/IsWarningMessageActive_2.md b/HUD/IsWarningMessageActive_2.md deleted file mode 100644 index 21a3038e2..000000000 --- a/HUD/IsWarningMessageActive_2.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -ns: HUD -aliases: ["0xAF42195A42C63BBA"] ---- -## _IS_WARNING_MESSAGE_ACTIVE_2 - -```c -// 0xAF42195A42C63BBA -BOOL _IS_WARNING_MESSAGE_ACTIVE_2(); -``` - -``` -IS_WARNING_MESSAGE_* -``` - -## Return value diff --git a/HUD/IsWarningMessageReadyForControl.md b/HUD/IsWarningMessageReadyForControl.md new file mode 100644 index 000000000..ba0cb6790 --- /dev/null +++ b/HUD/IsWarningMessageReadyForControl.md @@ -0,0 +1,13 @@ +--- +ns: HUD +aliases: ["0xAF42195A42C63BBA", "_IS_WARNING_MESSAGE_ACTIVE_2"] +--- +## IS_WARNING_MESSAGE_READY_FOR_CONTROL + +```c +// 0xAF42195A42C63BBA +BOOL IS_WARNING_MESSAGE_READY_FOR_CONTROL(); +``` + +## Return value +Returns if the warning message scaleform (popup_warning) is loaded. diff --git a/HUD/N_0x2e22fefa0100275e.md b/HUD/N_0x2e22fefa0100275e.md deleted file mode 100644 index e0de1161a..000000000 --- a/HUD/N_0x2e22fefa0100275e.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -ns: HUD ---- -## _0x2E22FEFA0100275E - -```c -// 0x2E22FEFA0100275E 0x96863460 -BOOL _0x2E22FEFA0100275E(); -``` - - -## Return value diff --git a/HUD/N_0xf284ac67940c6812.md b/HUD/N_0xf284ac67940c6812.md deleted file mode 100644 index 9a9e025f5..000000000 --- a/HUD/N_0xf284ac67940c6812.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -ns: HUD ---- -## _0xF284AC67940C6812 - -```c -// 0xF284AC67940C6812 0x7D95AFFF -Any _0xF284AC67940C6812(); -``` - - -## Return value diff --git a/HUD/PauseMenuGetIndexOfMouseHoveredSlot.md b/HUD/PauseMenuGetIndexOfMouseHoveredSlot.md deleted file mode 100644 index 8357124ce..000000000 --- a/HUD/PauseMenuGetIndexOfMouseHoveredSlot.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -ns: HUD -aliases: ["0x359AF31A4B52F5ED"] ---- -## _PAUSE_MENU_GET_INDEX_OF_MOUSE_HOVERED_SLOT - -```c -// 0x359AF31A4B52F5ED -int _PAUSE_MENU_GET_INDEX_OF_MOUSE_HOVERED_SLOT(); -``` - -If mouse is hovering on a slot, it returns the slot's index, else it returns -1. - -## Return value diff --git a/HUD/PauseMenuGetMouseHoverIndex.md b/HUD/PauseMenuGetMouseHoverIndex.md new file mode 100644 index 000000000..58e5e2684 --- /dev/null +++ b/HUD/PauseMenuGetMouseHoverIndex.md @@ -0,0 +1,13 @@ +--- +ns: HUD +aliases: ["0x359AF31A4B52F5ED", "_PAUSE_MENU_GET_INDEX_OF_MOUSE_HOVERED_SLOT"] +--- +## PAUSE_MENU_GET_MOUSE_HOVER_INDEX + +```c +// 0x359AF31A4B52F5ED +int PAUSE_MENU_GET_MOUSE_HOVER_INDEX(); +``` + +## Return value +If mouse is hovering on a slot, it returns the slot's index, else it returns -1. \ No newline at end of file diff --git a/HUD/PauseMenuGetMouseHoverUniqueId.md b/HUD/PauseMenuGetMouseHoverUniqueId.md new file mode 100644 index 000000000..5f5c8a22d --- /dev/null +++ b/HUD/PauseMenuGetMouseHoverUniqueId.md @@ -0,0 +1,13 @@ +--- +ns: HUD +aliases: ["0x13C4B962653A5280", "_PAUSE_MENU_GET_UNIQUE_ID_OF_MOUSE_HOVERED_SLOT"] +--- +## PAUSE_MENU_GET_MOUSE_HOVER_UNIQUE_ID + +```c +// 0x13C4B962653A5280 +int PAUSE_MENU_GET_MOUSE_HOVER_UNIQUE_ID(); +``` + +## Return value +If mouse is hovering on a slot, it returns uniqueid of that slot, else it returns -1. diff --git a/HUD/PauseMenuGetUniqueIdOfMouseHoveredSlot.md b/HUD/PauseMenuGetUniqueIdOfMouseHoveredSlot.md deleted file mode 100644 index cf88bb52a..000000000 --- a/HUD/PauseMenuGetUniqueIdOfMouseHoveredSlot.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -ns: HUD -aliases: ["0x13C4B962653A5280"] ---- -## _PAUSE_MENU_GET_UNIQUE_ID_OF_MOUSE_HOVERED_SLOT - -```c -// 0x13C4B962653A5280 -int _PAUSE_MENU_GET_UNIQUE_ID_OF_MOUSE_HOVERED_SLOT(); -``` - -If mouse is hovering on a slot, it returns uniqueid of that slot, else it returns -1. - -## Return value - diff --git a/HUD/SetMinimapComponent.md b/HUD/SetMinimapComponent.md index 1c7e64335..93832486d 100644 --- a/HUD/SetMinimapComponent.md +++ b/HUD/SetMinimapComponent.md @@ -5,24 +5,39 @@ ns: HUD ```c // 0x75A9A10948D1DEA6 0x419DCDC4 -Any SET_MINIMAP_COMPONENT(int componentID, BOOL toggle, int hudColor); +int SET_MINIMAP_COMPONENT(int componentID, BOOL toggle, int hudColor); ``` -This native is used to colorize certain map components like the army base at the top of the map. +This native is used to colorize/toggle certain map components like the army base. -An incomplete list of components ID: +Component IDs 6 through 14 are used by the freemode event King of the Castle in GTA Online. -0: Los Santos' air port yellow lift-off markers. -1: Sandy Shore's air port yellow lift-off markers. -2: Trevor's air port yellow lift-off markers. -6: Vespucci Beach lifeguard building. -15: Army base. +### An incomplete list of component IDs: -[List of hud colors](https://docs.fivem.net/docs/game-references/hud-colors/) +* **0**: Los Santos International Airport yellow runway markers +* **1**: Sandy Shores Airfield yellow runway markers +* **2**: McKenzie Field yellow runway markers +* **6**: Vespucci Beach lifeguard building +* **7**: Top level zone of Alien Camp (Hippy Camp) +* **8**: Paleto Bay fire station drill tower +* **9** Land Act Dam tower +* **10** Pala Springs Aerial Tramway +* **11** Galileo Observatory power unit +* **12** Small zone (empty "interior") near Central Los Santos Medical Center +* **13** Richman Mansion grotto +* **14** 2 Alien Camp (Hippy Camp) circles +* **15** Fort Zancudo ## Parameters * **componentID**: The component ID to change. -* **toggle**: True to enable the color, false to disable the effect. -* **hudColor**: The hudcolor index. +* **toggle**: True to enable/colorize, false to disable. +* **hudColor**: The hudcolor index, the list of hud colors can be found [here](https://docs.fivem.net/docs/game-references/hud-colors/). ## Return value +Hardcoded to always return 1 (int) + +## Examples +```lua +-- Enables Fort Zancudo on the map +SetMinimapComponent(15, true, 0) +``` diff --git a/INTERIOR/GetInteriorHeading.md b/INTERIOR/GetInteriorHeading.md index 99d7cb81c..17e164b0a 100644 --- a/INTERIOR/GetInteriorHeading.md +++ b/INTERIOR/GetInteriorHeading.md @@ -1,18 +1,20 @@ --- ns: INTERIOR +aliases: ["_GET_INTERIOR_HEADING"] --- -## _GET_INTERIOR_HEADING +## GET_INTERIOR_HEADING ```c // 0xF49B58631D9E22D9 -float _GET_INTERIOR_HEADING(int interior); +float GET_INTERIOR_HEADING(int interior); ``` ``` -GET_INTERIOR_* - NativeDB Introduced: v1493 ``` ## Parameters -* **interior**: +* **interior**: ID of the interior + +## Return value +Returns interior heading in radians. Multiply the returned value with 57.29578 (or 180.0 / math.pi) to convert it to degrees. diff --git a/MISC/ClearWeatherTypeNowPersistNetwork.md b/MISC/ClearWeatherTypeNowPersistNetwork.md new file mode 100644 index 000000000..806965652 --- /dev/null +++ b/MISC/ClearWeatherTypeNowPersistNetwork.md @@ -0,0 +1,29 @@ +--- +ns: MISC +aliases: ["0x0CF97F497FE7D048"] +--- +## CLEAR_WEATHER_TYPE_NOW_PERSIST_NETWORK + +```c +// 0x0CF97F497FE7D048 +void CLEAR_WEATHER_TYPE_NOW_PERSIST_NETWORK(cs_type(float) int transitionTimeInMs); +``` + +Clears the active weather type after a specific amount of time determined by `transitionTimeInMs`. + +## Parameters +* **transitionTimeInMs**: Transition time in milliseconds. + +## Examples +```lua +RegisterCommand('weathertransition', function(source, args) + -- Set the weather type to foggy so we can see the change + SetWeatherTypeNowPersist("FOGGY") + -- Clear the weather and run the transition + local transitionTimeInMs = tonumber(args[1]) or 5000 + if transitionTimeInMs > 0 then + ClearWeatherTypeNowPersistNetwork(transitionTimeInMs) + end +end, false) +``` + diff --git a/MISC/N_0x0cf97f497fe7d048.md b/MISC/N_0x0cf97f497fe7d048.md deleted file mode 100644 index d54f8380a..000000000 --- a/MISC/N_0x0cf97f497fe7d048.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -ns: MISC ---- -## _0x0CF97F497FE7D048 - -```c -// 0x0CF97F497FE7D048 -void _0x0CF97F497FE7D048(float p0); -``` - -``` -0 as param = weird black and green screen -0.1 - 0.99 = Prevent rain effect from falling (still sound and effects on puddles) and prevent puddles from increase/decrease, seems than it prevent any weather change too -1 and more = "Unfreeze" rain puddles but clear weather too -When 'freezing' is enabled, it seem to also freeze value getted with GetRainLevel -``` - -## Parameters -* **p0**: - diff --git a/MISC/SetCloudHatOpacity.md b/MISC/SetCloudHatOpacity.md deleted file mode 100644 index 768d2e3bd..000000000 --- a/MISC/SetCloudHatOpacity.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -ns: MISC -aliases: ["0xF36199225D6D8C86"] ---- -## _SET_CLOUD_HAT_OPACITY - -```c -// 0xF36199225D6D8C86 -void _SET_CLOUD_HAT_OPACITY(float opacity); -``` - - -## Parameters -* **opacity**: - diff --git a/MISC/SetCloudsAlpha.md b/MISC/SetCloudsAlpha.md new file mode 100644 index 000000000..01bb75e84 --- /dev/null +++ b/MISC/SetCloudsAlpha.md @@ -0,0 +1,43 @@ +--- +ns: MISC +aliases: ["0xF36199225D6D8C86", "_SET_CLOUD_HAT_OPACITY"] +--- +## SET_CLOUDS_ALPHA + +```c +// 0xF36199225D6D8C86 +void SET_CLOUDS_ALPHA(float opacity); +``` + +Allows modification of the cloud opacity. It can also be used in other contexts, such as when the player is in a switch state [`IS_PLAYER_SWITCH_IN_PROGRESS`](#_0xD9D2CFFF49FAB35F). + + +## Parameters +* **opacity**: The opacity value to set for clouds. + + +## Examples +```lua +-- Check if the player is in a Switch "state" +if IsPlayerSwitchInProgress() then + -- If the player is in a Switch state, set the clouds opacity to 1.0 + SetCloudsAlpha(1.0) +end +``` + +```js +// Check if the player is in a Switch "state" +if (IsPlayerSwitchInProgress()) { + // If the player is in a Switch state, set the clouds opacity to 1.0 + SetCloudsAlpha(1.0); +} +``` + +```cs +using static CitizenFX.Core.Native.API; +// Check if the player is in a Switch "state" +if (IsPlayerSwitchInProgress()) { + // If the player is in a Switch state, set the clouds opacity to 1.0 + SetCloudsAlpha(1f); +} +``` diff --git a/PLAYER/IsPlayerDrivingDangerously.md b/PLAYER/IsPlayerDrivingDangerously.md new file mode 100644 index 000000000..d6a42e84b --- /dev/null +++ b/PLAYER/IsPlayerDrivingDangerously.md @@ -0,0 +1,34 @@ +--- +ns: PLAYER +aliases: ["0xF10B44FD479D69F3"] +--- +## _IS_PLAYER_DRIVING_DANGEROUSLY + +```c +// 0xF10B44FD479D69F3 0x1E359CC8 +BOOL _IS_PLAYER_DRIVING_DANGEROUSLY(Player player, int type); +``` + +Violation types: +``` +enum eViolationType { + VT_PAVED_PEDESTRIAN_AREAS = 0, + VT_RUNNING_REDS, + VT_AGAINST_TRAFFIC +}; +``` + +Checks if a player is performing a certain type of traffic violation. + +* Type 0: Checks if the player is driving outside designated road areas pedestrians would walk on (specifically paved sidewalks). +* Type 1: Checks if the player is running through reds, takes some time to return true. +* Type 2: Checks if the player is driving on the wrong side of the road (against traffic). + +Used solely in "Al Di Napoli" with type 2 for a voiceline. + +## Parameters +* **player**: Player ID +* **type**: A violation type from 0 to 2 (`eViolationType`). + +## Return value +Whether or not the player is actively performing a certain type of traffic violation. diff --git a/PLAYER/N_0xf10b44fd479d69f3.md b/PLAYER/N_0xf10b44fd479d69f3.md deleted file mode 100644 index af9dc590c..000000000 --- a/PLAYER/N_0xf10b44fd479d69f3.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -ns: PLAYER ---- -## _0xF10B44FD479D69F3 - -```c -// 0xF10B44FD479D69F3 0x1E359CC8 -BOOL _0xF10B44FD479D69F3(Player player, int p1); -``` - -``` -Only 1 occurrence. p1 was 2. -``` - -## Parameters -* **player**: -* **p1**: - -## Return value diff --git a/STREAMING/GetPlayerSwitchState.md b/STREAMING/GetPlayerSwitchState.md index 7af112d29..67801a1f0 100644 --- a/STREAMING/GetPlayerSwitchState.md +++ b/STREAMING/GetPlayerSwitchState.md @@ -8,5 +8,36 @@ ns: STREAMING int GET_PLAYER_SWITCH_STATE(); ``` - ## Return value +- Returns 5 if the player is in the air (in a state of switch). +- Returns 12 if the player is either not in the air or if the switch is completed. + +## Examples +```lua +local stateSwitch = GetPlayerSwitchState() +if stateSwitch == 5 then + -- Player is in the air + elseif stateSwitch == 12 then + -- Player is not in the air or switch is completed +end +``` + +```javascript +const stateSwitch = GetPlayerSwitchState(); +if (stateSwitch == 5) { + // Player is in the air +} else if (stateSwitch == 12) { + // Player is not in the air or switch is completed +} +``` + +```csharp +using static CitizenFX.Core.Native.API; + +int stateSwitch = GetPlayerSwitchState(); +if (stateSwitch == 5) { + // Player is in the air +} else if (stateSwitch == 12) { + // Player is not in the air or switch is completed +} +``` diff --git a/STREAMING/SwitchInPlayer.md b/STREAMING/SwitchInPlayer.md deleted file mode 100644 index dd5ecc8a3..000000000 --- a/STREAMING/SwitchInPlayer.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -ns: STREAMING -aliases: ["0xD8295AF639FD9CB8"] ---- -## _SWITCH_IN_PLAYER - -```c -// 0xD8295AF639FD9CB8 0x2349373B -void _SWITCH_IN_PLAYER(Ped ped); -``` - -Use after using _SWITCH_OUT_PLAYER to swoop the camera back down to the player's ped. - -## Parameters -* **ped**: - diff --git a/STREAMING/SwitchOutPlayer.md b/STREAMING/SwitchOutPlayer.md deleted file mode 100644 index eef27d15a..000000000 --- a/STREAMING/SwitchOutPlayer.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -ns: STREAMING -aliases: ["0xAAB3200ED59016BC"] ---- -## _SWITCH_OUT_PLAYER - -```c -// 0xAAB3200ED59016BC 0xFB4D062D -void _SWITCH_OUT_PLAYER(Ped ped, int flags, int switchType); -``` - -``` -doesn't act normally when used on mount chilliad - -flags: - -0: normal -1: no transition -255: switch IN - -switchType: 0 - 3 - -0: 1 step towards ped -1: 3 steps out from ped -2: 1 step out from ped -3: 1 step towards ped -``` - -## Parameters -* **ped**: -* **flags**: -* **switchType**: - diff --git a/STREAMING/SwitchToMultiFirstpart.md b/STREAMING/SwitchToMultiFirstpart.md new file mode 100644 index 000000000..f4bdcc496 --- /dev/null +++ b/STREAMING/SwitchToMultiFirstpart.md @@ -0,0 +1,50 @@ +--- +ns: STREAMING +aliases: ["0xAAB3200ED59016BC", "_SWITCH_OUT_PLAYER"] +--- +## SWITCH_TO_MULTI_FIRSTPART + +```c +// 0xAAB3200ED59016BC 0xFB4D062D +void SWITCH_TO_MULTI_FIRSTPART(Ped ped, int flags, int switchType); +``` + +You can check if the player is in a Switch state with [`IS_PLAYER_SWITCH_IN_PROGRESS`](#_0xD9D2CFFF49FAB35F). + +_**Note:** Doesn't act normally when used on Mount Chiliad._ + +## Parameters +* **ped**: The Ped (player character) for which the switch is initiated. +* **flags**: Flags control various functionalities: 0 for normal behavior, 1 for no transition, and 255 for Switch IN. +* **switchType**: Specifies the type of switch (0 - 3): 0 for 1 step towards ped, 1 for 3 steps out from ped, 2 for 1 step out from ped, and 3 for 1 step towards ped. + +## Examples + +```lua +-- Check if the player is in a Switch "state" +if not IsPlayerSwitchInProgress() then + -- If the player is not already in a Switch state, initiate a Switch + SwitchToMultiFirstPart(PlayerPedId(), 0, 1) + -- In this case, switchType is set to 1, which means "3 steps out from ped" +end +``` + +```js +// Check if the player is in a Switch "state" +if (!IsPlayerSwitchInProgress()) { + // If the player is not already in a Switch state, initiate a Switch + SwitchToMultiFirstPart(PlayerPedId(), 0, 1); + // In this case, switchType is set to 1, which means "3 steps out from ped" according to the documentation +} +``` + +```csharp +using static CitizenFX.Core.Native.API; + +// Check if the player is in a Switch "state" +if (!IsPlayerSwitchInProgress()) { + // If the player is not already in a Switch state, initiate a Switch + SwitchToMultiFirstPart(API.PlayerPedId(), 0, 1); + // In this case, switchType is set to 1, which means "3 steps out from ped" according to the documentation +} +``` diff --git a/STREAMING/SwitchToMultiSecondpart.md b/STREAMING/SwitchToMultiSecondpart.md new file mode 100644 index 000000000..db6fd0eed --- /dev/null +++ b/STREAMING/SwitchToMultiSecondpart.md @@ -0,0 +1,48 @@ +--- +ns: STREAMING +aliases: ["0xD8295AF639FD9CB8", "_SWITCH_IN_PLAYER"] +--- +## SWITCH_TO_MULTI_SECONDPART + +```c +// 0xD8295AF639FD9CB8 0x2349373B +void SWITCH_TO_MULTI_SECONDPART(Ped ped); +``` + +After using [`SWITCH_TO_MULTI_FIRSTPART`](#_0xAAB3200ED59016BC) , use this native to smoothly return the camera to the player's character. + +## Parameters +* **ped**: + +## Examples +```lua +RegisterCommand("switchPlayer", function() + if IsPlayerSwitchInProgress() then return end + local ped = PlayerPedId() + SwitchToMultiFirstPart(ped, 0, 1) + Citizen.Wait(5000) + SwitchToMultiSecondPart(ped) +end, false) +``` + +```javascript +RegisterCommand("switchPlayer", () => { + if (IsPlayerSwitchInProgress()) return; + const ped = PlayerPedId(); + SwitchToMultiFirstPart(ped, 0, 1); + Delay(5000); // Delay doesn't exist, you have to make it yourself + SwitchToMultiSecondPart(ped); +}, false); +``` + +```csharp +using static CitizenFX.Core.Native.API; +RegisterCommand("switchPlayer", new Action, string>(async (user, args, raw) => +{ + if (IsPlayerSwitchInProgress()) return; + Ped ped = PlayerPedId(); + SwitchToMultiFirstPart(ped, 0, 1); + await Delay(5000); + SwitchToMultiSecondPart(ped); +}), false); +``` \ No newline at end of file diff --git a/VEHICLE/GetVehicleDoorDestroyType.md b/VEHICLE/GetVehicleDoorDestroyType.md deleted file mode 100644 index ed9c77179..000000000 --- a/VEHICLE/GetVehicleDoorDestroyType.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -ns: VEHICLE -aliases: ["0xCA4AC3EAAE46EC7B"] ---- -## _GET_VEHICLE_DOOR_DESTROY_TYPE - -```c -// 0xCA4AC3EAAE46EC7B -int _GET_VEHICLE_DOOR_DESTROY_TYPE(Vehicle vehicle, int doorIndex); -``` - -See eDoorId declared in [`SET_VEHICLE_DOOR_SHUT`](#_0x93D9BD300D7789E5) - -Returns vehicle door destroy type previously set with _SET_VEHICLE_DOOR_DESTROY_TYPE - -## Parameters -* **vehicle**: -* **doorIndex**: - -## Return value diff --git a/VEHICLE/GetVehicleIndividualDoorLockStatus.md b/VEHICLE/GetVehicleIndividualDoorLockStatus.md new file mode 100644 index 000000000..21a430a15 --- /dev/null +++ b/VEHICLE/GetVehicleIndividualDoorLockStatus.md @@ -0,0 +1,19 @@ +--- +ns: VEHICLE +aliases: ["0xCA4AC3EAAE46EC7B", "_GET_VEHICLE_DOOR_DESTROY_TYPE"] +--- +## GET_VEHICLE_INDIVIDUAL_DOOR_LOCK_STATUS + +```c +// 0xCA4AC3EAAE46EC7B +int GET_VEHICLE_INDIVIDUAL_DOOR_LOCK_STATUS(Vehicle vehicle, int doorIndex); +``` + +See eDoorId declared in [`SET_VEHICLE_DOOR_SHUT`](#_0x93D9BD300D7789E5) + +## Parameters +* **vehicle**: +* **doorIndex**: + +## Return value +Returns vehicle door lock state previously set with [`SET_VEHICLE_INDIVIDUAL_DOORS_LOCKED`](#_0xBE70724027F85BCD) \ No newline at end of file