NewLoadSceneStart
Docslocal retval = NewLoadSceneStart(posX, posY, posZ, offsetX, offsetY, offsetZ, radius, p7)Description
radius value is usually between 3f and 7000f in original 1868 scripts.p7 is 0, 1, 2, 3 or 4 used in decompiled scripts, 0 is by far the most common.
Returns True if success, used only 7 times in decompiled scripts of 1868
Parameters
| Name | Type | Description |
|---|---|---|
posX | float | World `x` coordinate. |
posY | float | World `y` coordinate. |
posZ | float | World `z` coordinate. |
offsetX | float | Offset `x` coordinate. |
offsetY | float | Offset `y` coordinate. |
offsetZ | float | Offset `z` coordinate. |
radius | float | Action radius, value is usually between `3f` and `7000f` in original 1868 scripts. |
p7 | int | 0, 1, 2, 3 or 4 used in decompiled scripts, 0 is by far the most common. |
Quick Snippet: Get CoordinatesposXposYposZoffsetX
posXposYposZoffsetXAdd 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
BOOLReturns TRUE (1) or FALSE (0).
Examples
Official
function func_8(vParam0)
return (-(Sin(vParam0.z)) * Cos(vParam0.x)), (Cos(vParam0.z) * Cos(vParam0.x)), Sin(vParam0.x)
end
Citizen.CreateThread(function()
local vLocal_43 = vector3(1691.228, 3251.785, 44.2574)
local vLocal_44 = vector3(2.5652, 0, -4.1481)
if NewLoadSceneStart(vLocal_43.x, vLocal_43.y, vLocal_43.z, func_8(vLocal_44), 4500.0, 0)) then
SetPlayerControl(PlayerId(), false, 0)
local gameTimer = GetGameTimer()
while not IsNewLoadSceneLoaded() and (GetGameTimer() - gameTimer < 20) do
Citizen.Wait(0)
end
NewLoadSceneStop()
SetFocusPosAndVel(vLocal_43.x, vLocal_43.y, vLocal_43.z, func_8(vLocal_44))
end
end)