GetOriginalWeaponProperty: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Server client function}}
{{Server client function}}
__NOTOC__
__NOTOC__
{{New feature/item|3.0120|1.2||
Only available in MTA:SA v1.2 and onwards.
}}
This function gets the original weapon property of the specified weapons specified weapon type.
This function gets the original weapon property of the specified weapons specified weapon type.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">int getOriginalWeaponProperty ( int weaponID/string weaponName, string weaponType, string property/int property )</syntaxhighlight>
<syntaxhighlight lang="lua">int getOriginalWeaponProperty ( int weaponID/string weaponName, string weaponSkill, string property/int property )</syntaxhighlight>


==Required Arguments==
==Required Arguments==
*'''weaponID or weaponName:''' The ID or name of the weapon you want to get info of see [[Weapons]]
*'''weaponID or weaponName:''' The ID or name of the weapon you want to get info of. Names are:
*'''weaponType:''' Either: "pro", "std" or "poor"
{{Weapon Types}}
*'''weaponSkill:''' Either: "pro", "std" or "poor"
*'''property:''' The property you want to get the value of:
*'''property:''' The property you want to get the value of:



Revision as of 06:08, 28 February 2012

This function gets the original weapon property of the specified weapons specified weapon type.

Syntax

int getOriginalWeaponProperty ( int weaponID/string weaponName, string weaponSkill, string property/int property )

Required Arguments

  • weaponID or weaponName: The ID or name of the weapon you want to get info of. Names are:

Template:Weapon Types

  • weaponSkill: 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"
    • "anim_loop_stop"
    • "anim_loop_bullet_fire"
    • "anim2_loop_start"
    • "anim2_loop_stop"
    • "anim2_loop_bullet_fire"
    • "anim_breakout_time"
    • "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 default weapon range of the M4 at poor skill level

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

Requirements

This template will be deleted.

See Also