SetWeaponFlags: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Added an example section and added this function to "Needs Example" template.) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{Needs_Example}} | |||
Set a custom weapons flags. | Set a custom weapons flags. | ||
Line 28: | Line 29: | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' on success (flags have 8 values), ''false'' otherwise. | Returns ''true'' on success (flags have 8 values), ''false'' otherwise. | ||
==Example== | |||
<syntaxhighlight lang="lua">--TODO</syntaxhighlight> | |||
==Requirements== | ==Requirements== |
Revision as of 22:42, 9 September 2013
Script Example Missing Function SetWeaponFlags needs a script example, help out by writing one. | |
Before submitting check out Editing Guidelines Script Examples. |
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 ( weapon 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.
Example
--TODO
Requirements
This template will be deleted.
See Also
- createWeapon
- fireWeapon
- getWeaponAmmo
- getWeaponClipAmmo
- getWeaponFiringRate
- getWeaponFlags
- getWeaponOwner
- getWeaponProperty
- getWeaponState
- getWeaponTarget
- resetWeaponFiringRate
- setWeaponAmmo
- setWeaponClipAmmo
- setWeaponFiringRate
- setWeaponFlags
- setWeaponProperty
- setWeaponState
- setWeaponTarget
sets the flags of the weapon ( used to determine what to hit )