setModel2DFXProperty
Client-side
Changes one property of one effect, including on an effect GTA shipped.
Syntax
bool setModel2DFXProperty(int model, int index, string property, var value)Arguments
modelintModel ID from 0 through 65535.
indexintEffect index on the model.
propertystringProperty name valid for that effect type.
valuevarNew value, matching that property's type.
Returns
true when applied; false for an invalid model, index, property or value.
Ownership and lifecycle
Custom effects belong to the resource that added them. Overrides and removals of original GTA effects are stacked per resource, so two resources editing the same model do not clobber each other, and stopping one rolls back only its own layer.
Important behavior
- Overrides on original GTA effects are stacked per resource, so two resources editing the same model do not clobber each other.
- This is the call the showcase uses for live colour waves, corona pulses and blink-mode changes.
Example
setModel2DFXProperty(1226, 0, "color", tocolor(255, 40, 40))Where this comes from
SOURCECLua2DFXDefs.cppClient/mods/deathmatch/logic/luadefs/CLua2DFXDefs.cpp INTRODUCED / EXTENDED27e3972e7Read the commit and why the change was made TEST RESOURCE 2dfx-test test-resources/2dfx-test
RELATED NEON APIS
Read the system guide →