SetDynamicPedShadowsEnabled

From Multi Theft Auto: Wiki
Revision as of 09:54, 17 April 2026 by Arran Fortuna (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
)

See Also