NetworkCreateSynchronisedScene
Docslocal retval = NetworkCreateSynchronisedScene(x, y, z, xRot, yRot, zRot, rotationOrder, holdLastFrame, looped, phaseToStopScene, phaseToStartScene, animSpeed)Description
Creates a networked synchronized scene.
Be sure to actually start the scene with <code>NETWORK_START_SYNCHRONISED_SCENE</code> after you're done adding peds or entities to the scene.
Parameters
| Name | Type | Description |
|---|---|---|
x | float | X coord of the scene position (If the scene is for an object, the position should be of the object's coordinates most of the time) |
y | float | Y coord of the scene position. |
z | float | Z coord of the scene position. |
xRot | float | Value x of the scene rotation. |
yRot | float | Value y of the scene rotation. |
zRot | float | Value z of the scene rotation (It's heading). |
rotationOrder | int | Rotation order. Default is 2. |
holdLastFrame | BOOL | If true, the scene stays on the last frame once it finishes, making `GetSynchronizedScenePhase` keep returning `1.0`. Script is expected to clean up it's memory and stop the animation if this is passed as true and the phase reaches `1.0`. |
looped | BOOL | If true, the scene will be looped and `holdLastFrame` will be disregarded. |
phaseToStopScene | float | Which phase (from `0.0` to `1.0` to stop the scene. Default is `1.0`) |
phaseToStartScene | float | Which phase (from `0.0` to `1.0` to start the scene. Default is `0.0`) |
animSpeed | float | Speed of the animation. Default is `1.0` |
Quick Snippet: Get CoordinatesxyzxRot
xyzxRotAdd this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Returns
intReturns an integer value.