Skip to content

Commit

Permalink
Add missing argument and improve documentation (#830)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
niekschoemaker and AvarianKnight authored Aug 9, 2024
1 parent ec20fcd commit 0247530
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions NETWORK/NetworkFadeInEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0247530

Please sign in to comment.