SetDynamicPedShadowsEnabled
Jump to navigation
Jump to search
This function allows scripts to override the current dynamic ped shadow setting on the client.
When used, it temporarily overrides the player’s video setting for dynamic ped shadows. To restore the original value based on the player's settings, use resetDynamicPedShadows.
Syntax
bool setDynamicPedShadowsEnabled ( bool enabled )
Required Arguments
- enabled: a boolean value specifying whether dynamic ped shadows should be enabled (true) or disabled (false).
Returns
Returns true if the setting was successfully applied, false otherwise.
Examples
-- Disable dynamic ped shadows setDynamicPedShadowsEnabled(false)
Example: Toggle shadows
local current = isDynamicPedShadowsEnabled() setDynamicPedShadowsEnabled(not current)
Example: Disable shadows on resource start and restore on stop
addEventHandler("onClientResourceStart", resourceRoot,
function()
setDynamicPedShadowsEnabled(false)
end
)
addEventHandler("onClientResourceStop", resourceRoot,
function()
resetDynamicPedShadows()
end
)