setWeaponRenderEnabled
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function allows you to completely disable/enable GTA weapon rendering for ped and player. It is particularly useful for creating custom weapon systems, where singular weapon ID could have many different models/variations, or to simply get rid of one frame delay when switching weapons.
If you want to selectively hide weapons use engineSetModelLODDistance with weapon model ID and value of 0.001 . Do note that game will still process default rendering regardless, which isn't the case when using this function to hide weapon models.
You can use it for example with optimized bone_attach resource called pAttach .
Syntax
setWeaponRenderEnabled ( )Code Examples
This example disables weapon rendering once resource has started.
function onClientResourceStartDisableWeaponRender() setWeaponRenderEnabled(false)endaddEventHandler("onClientResourceStart", resourceRoot, onClientResourceStartDisableWeaponRender)