GetWeaponFlags: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added an example section and added this function to "Needs Example" template.)
Line 8: Line 8:


===Required Arguments===
===Required Arguments===
* '''theWeapon:''' The weapon to set the flag of.
* '''theWeapon:''' The weapon to get the flag of.
* '''theFlag:''' The weapon flag to get:
* '''theFlag:''' The weapon flag to get:
** bool disable_model disable the weapon model of the weapon
** bool disable_model disable the weapon model of the weapon

Revision as of 22:15, 12 October 2014

Accessories-text-editor.png Script Example Missing Function GetWeaponFlags needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

Gets the flags of the custom weapon (used to determine what to hit)

Syntax

value getWeaponFlags ( weapon theWeapon, string theFlag )

Required Arguments

  • theWeapon: The weapon to get the flag of.
  • theFlag: The weapon flag to get:
    • 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

Returns

Returns the value(s) on success (flags have 8 values), false otherwise.

Example

--TODO

Requirements

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

Note: Using this feature 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