SetDynamicPedShadowsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(No difference)

Latest revision as of 10:08, 17 April 2026

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
)

See Also