diff --git a/VEHICLE/SetVehicleHasUnbreakableLights.md b/VEHICLE/SetVehicleHasUnbreakableLights.md index 3ef708da0..d8642e5bd 100644 --- a/VEHICLE/SetVehicleHasUnbreakableLights.md +++ b/VEHICLE/SetVehicleHasUnbreakableLights.md @@ -1,15 +1,47 @@ ---- -ns: VEHICLE -aliases: ["0x1AA8A837D2169D94","_SET_VEHICLE_LIGHTS_CAN_BE_VISIBLY_DAMAGED"] ---- -## SET_VEHICLE_HAS_UNBREAKABLE_LIGHTS - -```c -// 0x1AA8A837D2169D94 0x009AB49E -void SET_VEHICLE_HAS_UNBREAKABLE_LIGHTS(Vehicle vehicle, BOOL p1); -``` - -## Parameters -* **vehicle**: -* **p1**: - +--- +ns: VEHICLE +aliases: ["0x1AA8A837D2169D94","_SET_VEHICLE_LIGHTS_CAN_BE_VISIBLY_DAMAGED"] +--- +## SET_VEHICLE_HAS_UNBREAKABLE_LIGHTS + +```c +// 0x1AA8A837D2169D94 0x009AB49E +void SET_VEHICLE_HAS_UNBREAKABLE_LIGHTS(Vehicle vehicle, BOOL toggle); +``` + +Sets whether the vehicle's lights can be broken. + +``` +NativeDB Introduced: v323 +``` + +## Parameters +* **vehicle**: The target vehicle. +* **toggle**: Set the lights' breakability `true` makes lights unbreakable, `false` allows them to break. + +## Examples +```lua +local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) +if not vehicle then return end + +-- Make the vehicle's lights unbreakable +SetVehicleHasUnbreakableLights(vehicle, true) +``` + +```js +const vehicle = GetVehiclePedIsIn(PlayerPedId(), false); +if (!vehicle) return; + +// Make the vehicle's lights unbreakable +SetVehicleHasUnbreakableLights(vehicle, true); +``` + +```cs +using static CitizenFX.Core.Native.API; + +int vehicle = GetVehiclePedIsIn(PlayerPedId(), false); +if (vehicle == 0) return; + +// Make the vehicle's lights unbreakable +SetVehicleHasUnbreakableLights(vehicle, true); +``` \ No newline at end of file diff --git a/VEHICLE/SetVehicleHeadlightShadows.md b/VEHICLE/SetVehicleHeadlightShadows.md new file mode 100644 index 000000000..c6f45e46e --- /dev/null +++ b/VEHICLE/SetVehicleHeadlightShadows.md @@ -0,0 +1,60 @@ +--- +ns: VEHICLE +aliases: ["0x1FD09E7390A74D54", "_SET_VEHICLE_LIGHTS_MODE"] +--- +## SET_VEHICLE_HEADLIGHT_SHADOWS + +```c +// 0x1FD09E7390A74D54 +void SET_VEHICLE_HEADLIGHT_SHADOWS(Vehicle vehicle, int flag); +``` + +Sets the vehicle headlight shadow flags. + +``` +NativeDB Introduced: v323 +``` + +```c +enum eVehicleHeadlightShadowFlags { + // Default (Lights can be toggled between off, normal and high beams) + NO_HEADLIGHT_SHADOWS = 0, + // Lights Disabled (Lights are fully disabled, cannot be toggled) + HEADLIGHTS_CAST_DYNAMIC_SHADOWS = 1, + // Always On (Lights can be toggled between normal and high beams) + HEADLIGHTS_CAST_STATIC_SHADOWS = 2, + HEADLIGHTS_CAST_FULL_SHADOWS = 3 +}; +``` + +## Parameters +* **vehicle**: The target vehicle. +* **flag**: A value from `eVehicleHeadlightShadowFlags` representing the desired headlight shadow flag. + + +## Examples +```lua +local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) +if not vehicle then return end + +-- Set the vehicle headlight shadows to cast static shadows (always on) +SetVehicleHeadlightShadows(vehicle, 2) +``` + +```js +const vehicle = GetVehiclePedIsIn(PlayerPedId(), false); +if (!vehicle) return; + +// Set the vehicle headlight shadows to cast static shadows (always on) +SetVehicleHeadlightShadows(vehicle, 2); +``` + +```cs +using static CitizenFX.Core.Native.API; + +int vehicle = GetVehiclePedIsIn(PlayerPedId(), false); +if (vehicle == 0) return; + +// Set the vehicle headlight shadows to cast static shadows (always on) +SetVehicleHeadlightShadows(vehicle, 2); +``` \ No newline at end of file diff --git a/VEHICLE/SetVehicleLights.md b/VEHICLE/SetVehicleLights.md index 2b5cf4842..e497a53c1 100644 --- a/VEHICLE/SetVehicleLights.md +++ b/VEHICLE/SetVehicleLights.md @@ -1,26 +1,66 @@ ---- -ns: VEHICLE ---- -## SET_VEHICLE_LIGHTS - -```c -// 0x34E710FF01247C5A 0xE8930226 -void SET_VEHICLE_LIGHTS(Vehicle vehicle, int state); -``` - -``` -set's if the vehicle has lights or not. -not an on off toggle. -p1 = 0 ;vehicle normal lights, off then lowbeams, then highbeams -p1 = 1 ;vehicle doesn't have lights, always off -p1 = 2 ;vehicle has always on lights -p1 = 3 ;or even larger like 4,5,... normal lights like =1 -note1: when using =2 on day it's lowbeam,highbeam -but at night it's lowbeam,lowbeam,highbeam -note2: when using =0 it's affected by day or night for highbeams don't exist in daytime. -``` - -## Parameters -* **vehicle**: -* **state**: - +--- +ns: VEHICLE +--- +## SET_VEHICLE_LIGHTS + +```c +// 0x34E710FF01247C5A 0xE8930226 +void SET_VEHICLE_LIGHTS(Vehicle vehicle, int state); +``` + +Sets the vehicle lights state. Allowing for different lighting modes. + +``` +NativeDB Introduced: v323 +``` + +```c +enum eVehicleLightSetting { + // Normal light behavior. Lights cycle through off, then low beams, then high beams. + // Note: It's affected by day or night; high beams don't exist in daytime. + NO_VEHICLE_LIGHT_OVERRIDE = 0, + // Vehicle doesn't have lights, always off. + FORCE_VEHICLE_LIGHTS_OFF = 1, + // Vehicle has always-on lights. + // During day: Cycles between low beams and high beams. + // At night: Cycles between low beams, low beams, and high beams. + FORCE_VEHICLE_LIGHTS_ON = 2, + // Sets vehicle lights on. Behaves like normal lights (same as 0). + SET_VEHICLE_LIGHTS_ON = 3, + // Sets vehicle lights off. Behaves like normal lights (same as 0). + SET_VEHICLE_LIGHTS_OFF = 4 +}; +``` + + +## Parameters +* **vehicle**: The target vehicle. +* **state**: A value from `eVehicleLightSetting` representing the desired light setting. + + +## Examples +```lua +local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) +if not vehicle then return end + +-- Set the vehicle lights to always on +SetVehicleLights(vehicle, 2) +``` + +```js +const vehicle = GetVehiclePedIsIn(PlayerPedId(), false); +if (!vehicle) return; + +// Set the vehicle lights to always on +SetVehicleLights(vehicle, 2); +``` + +```cs +using static CitizenFX.Core.Native.API; + +int vehicle = GetVehiclePedIsIn(PlayerPedId(), false); +if (vehicle == 0) return; + +// Set the vehicle lights to always on +SetVehicleLights(vehicle, 2); +``` diff --git a/VEHICLE/SetVehicleLightsMode.md b/VEHICLE/SetVehicleLightsMode.md deleted file mode 100644 index 34684c449..000000000 --- a/VEHICLE/SetVehicleLightsMode.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -ns: VEHICLE -aliases: ["0x1FD09E7390A74D54"] ---- -## _SET_VEHICLE_LIGHTS_MODE - -```c -// 0x1FD09E7390A74D54 -void _SET_VEHICLE_LIGHTS_MODE(Vehicle vehicle, int p1); -``` - -``` -p1 can be either 0, 1 or 2. -Determines how vehicle lights behave when toggled. -0 = Default (Lights can be toggled between off, normal and high beams) -1 = Lights Disabled (Lights are fully disabled, cannot be toggled) -2 = Always On (Lights can be toggled between normal and high beams) -``` - -## Parameters -* **vehicle**: -* **p1**: -