Difference between revisions of "SetWeaponFlags"

From Multi Theft Auto: Wiki
m (usage note)
Line 2: Line 2:
 
{{Client function}}
 
{{Client function}}
 
Set a custom weapons flags.
 
Set a custom weapons flags.
 +
 +
'''Note:''' This is not the same as [[setWeaponProperty]]. These flags are different and can only be set for custom weapon types. You cannot set these flags for 'normal' weapons. This is true despite the ability in setWeaponProperty to set any number of supported [[Weapon Flags]].
  
 
==Syntax==
 
==Syntax==

Revision as of 13:53, 15 October 2012

Set a custom weapons flags.

Note: This is not the same as setWeaponProperty. These flags are different and can only be set for custom weapon types. You cannot set these flags for 'normal' weapons. This is true despite the ability in setWeaponProperty to set any number of supported Weapon Flags.

Syntax

bool setWeaponFlags ( theWeapon, string theFlag, value TheValue )

Required Arguments

  • theWeapon: the weapon to set the flag of
  • theFlag: the weapon flag to set:
    • bool disable_model disable the weapon model of the weapon
    • flags edit the processLineOfSight flags used to find the hit position
    • bool checkBuildings
    • bool checkCarTires
    • bool checkDummies
    • bool checkObjects
    • bool checkPeds
    • bool checkVehicles
    • bool checkSeeThroughStuff
    • bool checkShootThroughStuff
    • bool instant_reload reload the weapon instantly rather than doing a reload
    • bool shoot_if_out_of_range shoot the target position if out of weapon range
    • bool shoot_if_blocked shoot the target position if blocked
  • theValue: the value to set

Returns

Returns true on success (flags have 8 values), false otherwise.

Requirements

Minimum supported server n/a
Minimum supported client 1.3.0-9.04555

Note: Using this function requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.0-9.04555" />

See Also


sets the flags of the weapon ( used to determine what to hit )