SetWeaponRenderEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Add setWeaponRenderEnabled by FileEX (https://github.com/multitheftauto/mtasa-blue/pull/3917))
 
No edit summary
Line 2: Line 2:
{{Client function}}
{{Client function}}
{{New feature/item|3.0161|1.6.0|22880|This function allows you to disable GTA weapon rendering for [[ped]], [[player]]. It is particularly useful for creating custom weapon systems, where sole weapon ID could have many different custom models.}}
{{New feature/item|3.0161|1.6.0|22880|This function allows you to disable GTA weapon rendering for [[ped]], [[player]]. It is particularly useful for creating custom weapon systems, where sole weapon ID could have many different custom models.}}
{{Tip|You can use it for example with: optimized bone_attach resource called [https://github.com/Patrick2562/mtasa-pAttach pAttach].}}
{{Tip|You can use it for example with optimized bone_attach resource called [https://github.com/Patrick2562/mtasa-pAttach pAttach].}}


==Syntax==
==Syntax==

Revision as of 12:16, 4 January 2025

ADDED/UPDATED IN VERSION 1.6.0 r22880:
This function allows you to disable GTA weapon rendering for ped, player. It is particularly useful for creating custom weapon systems, where sole weapon ID could have many different custom models.
[[{{{image}}}|link=|]] Tip: You can use it for example with optimized bone_attach resource called pAttach.

Syntax

bool setWeaponRenderEnabled ( bool enabled )

Required Arguments

  • enabled: Whether weapon render should be enabled.

Returns

Always returns true.

Example

This example disables weapon rendering once resource has started.

function onClientResourceStartDisableWeaponRender()
	setWeaponRenderEnabled(false)
end
addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStartDisableWeaponRender)

See Also