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

NetworkCreateSynchronisedScene improvements #922

Closed
wants to merge 1 commit into from
Closed
Changes from all 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
24 changes: 23 additions & 1 deletion NETWORK/NetworkCreateSynchronisedScene.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,26 @@ int NETWORK_CREATE_SYNCHRONISED_SCENE(float x, float y, float z, float xRot, flo
* **animSpeed**:

## Return value
netScene id
Network scene handle. This can be used to start / stop it and add peds or entities to it.

## Examples:
Copy link
Contributor

Choose a reason for hiding this comment

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

Examples cannot have a colon (:).

```lua
local ped = PlayerPedId()
local pedCo = GetEntityCoords(ped)
local sceneObject = GetClosestObjectOfType(pedCo, 2.0, GetEntityModel('prop_weed_01'), false, false, false)
Comment on lines +31 to +32
Copy link
Contributor

@4mmonium 4mmonium Oct 9, 2023

Choose a reason for hiding this comment

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

Small nitpick, I think changing pedCo to pedCoords would be better for readability here.

Copy link
Author

Choose a reason for hiding this comment

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

I'm going to change everything you just told me

local animDict = 'anim@gangops@facility@servers@bodysearch@'

RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do Wait(0) end

local netScene = NetworkCreateSynchronisedScene(GetEntityCoords(sceneObject), GetEntityRotation(sceneObject), 2, true, false, 1, 15.666667, 1.0)
NetworkAddPedToSynchronisedScene(ped, netScene, animDict, 'player_search', 1.0, 1.0, 15.666667, 17957384, 0) -- 15.666667 is the duration of this anim

NetworkStartSynchronisedScene(netScene)
Wait(15.666667)
NetworkStopSynchronisedScene(netScene)
ClearPedTasks(ped)
```

## Advanced example
You can find an advanced example [here](https://pastebin.com/masLVdm5)
Comment on lines +47 to +48
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be on the description, above parameters section. Also, 'double hash' (##) custom headers like these are not allowed, but 'triple hash' headers are. (###), so ideally ### Advanced example.

It's also somewhat discouraged to use pastebin links since they can expire/get removed, causing the research to be lost.

Loading