pauseDynamic
pauseDynamic(state [bool],vehNetID [int],shouldControlCamera [bool],shouldControlNui [bool])
Pauses dynamic execution overall. If called when using a vehicle, dynamic will act as if you left the vehicle. If unpaused when in a vehicle, dynamic will load regularly. This native does not reset it's state once you get out of the vehicle, meaning you must keep track if it is currently paused or not. You may get the current state with this export. If the player is not in a vehicle, parse the vehNetId as 0. Usage of this native is recommended for UI's, such as dealerships, main menus, etc. shouldControlCamera: When enabled, will also pause the camera, which follow the same rules as this export (will stop camera if paused, return if unpaused) shouldControlNui: When enabled, will also hide the NUI, which follow the same rules as mentioned above.
Usage example:
-- example of starting a main menu:
if not dynamic:getDynamicPauseStatus() then
dynamic:pauseDynamic(true,0,true,true)
end
-- example of stopping a main menu:
if dynamic:getDynamicPauseStatus() then
dynamic:pauseDynamic(false,NetworkGetNetworkIdFromEntity(currentHomeCarEntity),true,true)
end
-- example of starting while in a main menu:
if dynamic:getDynamicPauseStatus() then
dynamic:pauseDynamic(false,NetworkGetNetworkIdFromEntity(currentHomeCarEntity),false)
end
-- example of stopping while in a main menu:
if not dynamic:getDynamicPauseStatus() then
dynamic:pauseDynamic(true,NetworkGetNetworkIdFromEntity(currentHomeCarEntity),false)
end
Last updated