SetDynamicPedShadowsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} 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== <syntaxhighlight lang="lua"> bool setDynamicPedShadowsEnabled ( bool enabled ) </syntaxhighlight> ===Required Arguments=== *'''enabled:''' a boolean val...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 44: Line 44:


==See Also==
==See Also==
* [[isDynamicPedShadowsEnabled]]
{{Client world functions}}
* [[resetDynamicPedShadows]]
* [[Client functions]]

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