GetWeaponProperty: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 18: Line 18:
** "accuracy"
** "accuracy"
** "damage"
** "damage"
** "life_span" // Disabled for release
** "life_span" // Get only
** "firing_speed" // Disabled for release
** "firing_speed" // Get only
** "spread" // Disabled for release
** "spread" // Get only
** "maximum_clip_ammo" )
** "maximum_clip_ammo"
** "move_speed" )
** "move_speed"
** "flags" )
** "flags"  
** "anim_group" ) // Disabled for release
** "anim_group" // Get only
** // Set is Disabled >= FIRETYPE - Move above WEAPON_TYPE_SET_DISABLED to re-enable and move it above here to make it less confusing.
** "fire_type" // Get only
** "fire_type"
** "model" // Get only
** "model"
** "model2" // Get only
** "model2"
** "weapon_slot" // Get only
** "weapon_slot"
** "fire_offset" // Get only
** "fire_offset"
** "skill_level" // Get only
** "skill_level"
** "required_skill_level" // Get only
** "required_skill_level"
** "anim_loop_start" // Get only
** "anim_loop_start"
** "anim_loop_stop" // Get only
** "anim_loop_stop"
** "anim_loop_bullet_fire" // Get only
** "anim_loop_bullet_fire"
** "anim2_loop_start" // Get only
** "anim2_loop_start"
** "anim2_loop_stop" // Get only
** "anim2_loop_stop"
** "anim2_loop_bullet_fire" // Get only
** "anim2_loop_bullet_fire"
** "anim_breakout_time" // Get only
** "anim_breakout_time"  
** "radius" // Get only
** "radius"  
** "aim_offset" // Get only
** "aim_offset"
** "default_combo" // Get only
** "default_combo"
** "combos_available" // Get only
** "combos_available"


==Returns==
==Returns==

Revision as of 00:06, 17 November 2011

Only available in MTA:SA v1.2 and onwards. This function gets the weapon property of the specified weapons specified weapon type.

Syntax

int theValue = getWeaponProperty ( int weaponID, string weaponType, string property )

Required Arguments

  • weaponID: The ID of the weapon you want to get info of see Weapons
  • weaponType: Either: "pro", "std" or "poor"
  • property: The property you want to get the value of:
    • "weapon_range"
    • "target_range"
    • "accuracy"
    • "damage"
    • "life_span" // Get only
    • "firing_speed" // Get only
    • "spread" // Get only
    • "maximum_clip_ammo"
    • "move_speed"
    • "flags"
    • "anim_group" // Get only
    • "fire_type" // Get only
    • "model" // Get only
    • "model2" // Get only
    • "weapon_slot" // Get only
    • "fire_offset" // Get only
    • "skill_level" // Get only
    • "required_skill_level" // Get only
    • "anim_loop_start" // Get only
    • "anim_loop_stop" // Get only
    • "anim_loop_bullet_fire" // Get only
    • "anim2_loop_start" // Get only
    • "anim2_loop_stop" // Get only
    • "anim2_loop_bullet_fire" // Get only
    • "anim_breakout_time" // Get only
    • "radius" // Get only
    • "aim_offset" // Get only
    • "default_combo" // Get only
    • "combos_available" // Get only

Returns

On success:

int: The weapon property

On failure:

bool: False if the passed arguments were invalid

Example

This example gets the weapon range of the M4 at poor skill level

local range = getWeaponProperty(31, "poor", "weapon_range")
outputChatBox("M4 range at poor is: "..tostring(range))

See Also