-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
```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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small nitpick, I think changing There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be on the description, above parameters section. Also, 'double hash' ( It's also somewhat discouraged to use pastebin links since they can expire/get removed, causing the research to be lost. |
There was a problem hiding this comment.
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 (
:
).