From 0247530c830846425fae801d224646a219924ebf Mon Sep 17 00:00:00 2001 From: Niek <32094562+niekschoemaker@users.noreply.github.com> Date: Fri, 9 Aug 2024 21:44:25 +0200 Subject: [PATCH] Add missing argument and improve documentation (#830) * Add missing argument and improve documentation I'm not 100% sure as to what the arguments do exactly because the behavior of the native changes depending on whether oal is enabled or not, not sure what's going on there, I'm assuming this is due to the missing argument. Without OAL it always does the non flashing fade in, and with OAL it always does the flashing fade in, even though this is not the actual missing argument. * Add arguments to NETWORK_FADE_IN_ENTITY * Update NetworkFadeInEntity.md * Apply suggestions from code review * Apply suggestions from code review * fix not renaming network param --------- Co-authored-by: Dillon Skaggs --- NETWORK/NetworkFadeInEntity.md | 39 ++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/NETWORK/NetworkFadeInEntity.md b/NETWORK/NetworkFadeInEntity.md index 9393b7acb..79e775a5b 100644 --- a/NETWORK/NetworkFadeInEntity.md +++ b/NETWORK/NetworkFadeInEntity.md @@ -5,20 +5,37 @@ ns: NETWORK ```c // 0x1F4ED342ACEFE62D 0x9B9FCD02 -void NETWORK_FADE_IN_ENTITY(Entity entity, BOOL state); +void NETWORK_FADE_IN_ENTITY(Entity entity, BOOL bNetwork); ``` -``` -state - 0 does 5 fades -state - 1 does 6 fades -native is missing third argument, also boolean, setting to 1 made vehicle fade in slower, probably "slow" as per NETWORK_FADE_OUT_ENTITY -``` +Fade the given entity back in, usually used after the entity has been faded out with [NETWORK_FADE_OUT_ENTITY](#_0xDE564951F95E09ED) + +When used on a entity which isn't invisible or faded out then the native will still work, it will just instanly make the ped invisible before fading in. + +**Additional Parameters**: +* **flash**: If set to true the entity will flash while fading in. -``` -NativeDB Added Parameter 3: BOOL slow -``` ## Parameters -* **entity**: -* **state**: +* **entity**: The entity to fade in +* **bNetwork**: When set to true the fade in will be networked. + +## Examples + +```lua +local playerPed = PlayerPedId() + +-- fade out the player while flashing them +NetworkFadeOutEntity(playerPed, true, false) +while NetworkIsEntityFading(playerPed) do + Wait(0) +end + +--- Do something like a teleport, or warp into a vehicle +-- while generally frowned upon when you can use natives, this declaration has +-- a missing parameter, which doesn't work without manually invoking. +Citizen.InvokeNative(0x1F4ED342ACEFE62D, playerPed, false, true) +while NetworkIsEntityFading(playerPed) do + Wait(0) +end