Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NetworkAddEntityToSynchronisedScene.md #829

Closed
wants to merge 5 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions NETWORK/NetworkAddEntityToSynchronisedScene.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,42 @@ ns: NETWORK

```c
// 0xF2404D68CBC855FA 0x10DD636C
void NETWORK_ADD_ENTITY_TO_SYNCHRONISED_SCENE(Entity entity, int netScene, char* animDict, char* animName, float speed, float speedMulitiplier, int flag);
void NETWORK_ADD_ENTITY_TO_SYNCHRONISED_SCENE(Entity entity, int netScene, char* animDict, char* animName, float blendInSpeed, float blendOutSpeed, float flag);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find any evidence of the flag being a float value, I will explain down below in the ## Parameters section

```


## Parameters
* **entity**:
* **netScene**:
* **animDict**:
* **animName**:
* **speed**:
* **speedMulitiplier**:
* **flag**:
### Parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things such as ## Parameters and ## Example don't need triple hashes, only custom headers do. Custom headers in this case are ### Animation Dictionaries, ### Animations, ### Used With. Basically any headers that you add that aren't commonly used in native docs.

* **entity**: The Entity that the animation is gonna play on (Recomended that the entity is serversided for best syncing).
* **netScene**: scene id.
* **animDict**: The animDict of the animation that you want to play (remember you have to load with RequestAnimDict() before executing this native)
* **animName**: The name of the animation that the entity is gonna play.
* **blendInSpeed**: a float (normal speed is 8.0f).
* **blendOutSpeed**: a float (normal speed is -8.0f).
* **flag**: A float 1000.0f (Also doesn't seem to affect anything).
Copy link
Contributor

@4mmonium 4mmonium Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my research of this native method, flag is still an int.

If blendInSpeed is lesser or equal to 0.0, it's forced by the game to an ieee-754 value of 1000.0 (float).

If blendOutSpeed is greater or equal to 0.0, the game forces the value to -1000.0 (float).
So judging by this, blendInSpeed should be greater than 0.0 and blendOutSpeed lower.

You can find more about the ieee-754 specification here.


### Animation Dictionaries
* **Animation List**: https://alexguirre.github.io/animations-list/
* **Other Option**: More likely to find your desired animation by just searching OpenIV
* Most can be found here: (Gta V path)\update\x64\dlcpacks\(Desired folder like mpheist)\dlc.rpf\x64\anim\ingame\[email protected]\
* Most usefull ones start with anim@scripted@...

### Animations
* **Animation List**: https://alexguirre.github.io/animations-list/
* **Other Option**: You are much more likely to find the animation by opening [CodeWalker's](https://pl.gta5-mods.com/tools/codewalker-gtav-interactive-3d-map) Ped Viewer and putting the AnimDict into the search bar.

### Used With
4mmonium marked this conversation as resolved.
Show resolved Hide resolved
* **NetworkAddPedToSynchronisedScene**: https://docs.fivem.net/natives/?_0x742A637471BCECD9.
* **NetworkAddEntityToSynchronisedScene**: https://docs.fivem.net/natives/?_0xF2404D68CBC855FA.
* **NetworkCreateSynchronisedScene**: https://docs.fivem.net/natives/?_0x7CD6BC4C2BBDD526.

### Example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need triple hashes, only custom headers do, you can use double hashes here 🙂

```lua
ped = PlayerPedId()
pedCoords = GetEntityCoords(ped)
animDict = 'anim@scripted@heist@ig9_control_tower@male@'
loadAnimDict(animDict) --Not a fivem native a function that you have to create yourself

scene = NetworkCreateSynchronisedScene(GetEntityCoords(Object), GetEntityRotation(Object), 2, true, false, 100065353216, 0, 1065353216)
Object = GetClosestObjectOfType(pedCoords.x,pedCoords.y,pedCoords.z, 2.5, GetHashKey('h4_prop_h4_elecbox_01a'), 0, 0, 0)
NetworkAddEntityToSynchronisedScene(Object, scene, animDict, 'exit_electric_box', 1.0, -1.0, 1000.0)
```