GetWeaponFlags: Difference between revisions
Jump to navigation
Jump to search
(Added OOP syntax and improved some things) |
|||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
{{Needs_Example}} | {{Needs_Example}} | ||
This function gets the flags of a [[Element/Weapon|custom weapon]]. Please refer to [[setWeaponFlags]] for details. | |||
==Syntax== | ==Syntax== | ||
Line 8: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
* '''theWeapon:''' | * '''theWeapon:''' the weapon to get the flag of. | ||
* '''theFlag:''' | * '''theFlag:''' the weapon flag to get: | ||
** | ** '''disable_model''': makes the weapon and muzzle effect invisible or not. | ||
** flags | ** '''flags''': configures the flags used to get where the gun shoots at. They are based on [[processLineOfSight]]'s. You have to specify all the eight flags for the function to succeed. These flags are (by order): | ||
** | *** '''checkBuildings''': allows the shoot to be blocked by GTA's internally placed buildings, i.e. the world map. | ||
** | *** '''checkCarTires''': allows the shoot to be blocked by [[vehicle]] tires. | ||
** | *** '''checkDummies''': allows the shoot to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to ''false''. | ||
** | *** '''checkObjects''': allows the shoot to be blocked by [[object|objects]]. | ||
** | *** '''checkPeds''': allows the shoot to be blocked by [[ped|peds]] and [[player|players]]. | ||
** | *** '''checkVehicles''': allows the shoot to be blocked by [[vehicle|vehicles]]. | ||
** | *** '''checkSeeThroughStuff''': allows the shoot to be blocked by translucent game objects, e.g. glass. | ||
** | *** '''checkShootThroughStuff''': allows the shoot to be blocked by things that can be shot through. | ||
** | ** '''instant_reload''': if enabled, the weapon will reload instantly rather than waiting the reload time until shooting again. | ||
** | ** '''shoot_if_out_of_range''': if enabled, the weapon will still fire its target beyond the weapon range distance. | ||
** | ** '''shoot_if_blocked''': if enabled, the weapon will still fire its target even if it's blocked by something. | ||
===Returns=== | ===Returns=== | ||
Returns the '' | Returns the ''true'' or ''false'' on success (''flags'' flag returns 8 values) if the flag is enabled or not. Returns ''false'' if the weapon element isn't valid or an error occured. | ||
==Example== | ==Example== | ||
Line 33: | Line 33: | ||
{{Requirements|n/a|1.3.0-9.04555|}} | {{Requirements|n/a|1.3.0-9.04555|}} | ||
==See | ==See also== | ||
{{Client weapon creation functions}} | {{Client weapon creation functions}} |
Revision as of 16:31, 23 December 2014
Script Example Missing Function GetWeaponFlags needs a script example, help out by writing one. | |
Before submitting check out Editing Guidelines Script Examples. |
This function gets the flags of a custom weapon. Please refer to setWeaponFlags for details.
Syntax
value getWeaponFlags ( weapon theWeapon, string theFlag )
Required Arguments
- theWeapon: the weapon to get the flag of.
- theFlag: the weapon flag to get:
- disable_model: makes the weapon and muzzle effect invisible or not.
- flags: configures the flags used to get where the gun shoots at. They are based on processLineOfSight's. You have to specify all the eight flags for the function to succeed. These flags are (by order):
- checkBuildings: allows the shoot to be blocked by GTA's internally placed buildings, i.e. the world map.
- checkCarTires: allows the shoot to be blocked by vehicle tires.
- checkDummies: allows the shoot to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to false.
- checkObjects: allows the shoot to be blocked by objects.
- checkPeds: allows the shoot to be blocked by peds and players.
- checkVehicles: allows the shoot to be blocked by vehicles.
- checkSeeThroughStuff: allows the shoot to be blocked by translucent game objects, e.g. glass.
- checkShootThroughStuff: allows the shoot to be blocked by things that can be shot through.
- instant_reload: if enabled, the weapon will reload instantly rather than waiting the reload time until shooting again.
- shoot_if_out_of_range: if enabled, the weapon will still fire its target beyond the weapon range distance.
- shoot_if_blocked: if enabled, the weapon will still fire its target even if it's blocked by something.
Returns
Returns the true or false on success (flags flag returns 8 values) if the flag is enabled or not. Returns false if the weapon element isn't valid or an error occured.
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