GetWeaponProperty: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
** "accuracy" | ** "accuracy" | ||
** "damage" | ** "damage" | ||
** "life_span" | ** "life_span" '''Get only''' | ||
** "firing_speed" | ** "firing_speed" '''Get only | ||
** "spread" | ** "spread" '''Get only''' | ||
** "maximum_clip_ammo" | ** "maximum_clip_ammo" | ||
** "move_speed" | ** "move_speed" | ||
** "flags" See [[Weapon Flags]] | ** "flags" See [[Weapon Flags]] | ||
** "anim_group" | ** "anim_group" '''Get only''' | ||
** "fire_type" | ** "fire_type" '''Get only''' | ||
** "model" | ** "model" '''Get only''' | ||
** "model2" | ** "model2" '''Get only''' | ||
** "weapon_slot" | ** "weapon_slot" '''Get only''' | ||
** "fire_offset" | ** "fire_offset" '''Get only''' | ||
** "skill_level" | ** "skill_level" '''Get only''' | ||
** "required_skill_level" | ** "required_skill_level" '''Get only''' | ||
** "anim_loop_start" | ** "anim_loop_start" | ||
** "anim_loop_stop" | ** "anim_loop_stop" | ||
Line 37: | Line 37: | ||
** "anim2_loop_bullet_fire" | ** "anim2_loop_bullet_fire" | ||
** "anim_breakout_time" | ** "anim_breakout_time" | ||
** "radius" | ** "radius" '''Get only''' | ||
** "aim_offset" | ** "aim_offset" '''Get only''' | ||
** "default_combo" | ** "default_combo" '''Get only''' | ||
** "combos_available" | ** "combos_available" '''Get only''' | ||
==Returns== | ==Returns== |
Revision as of 00:05, 18 October 2012
This function gets the weapon property of the specified weapons specified weapon type.
Syntax
int getWeaponProperty ( 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 can be:
- grenade
- teargas
- molotov
- colt 45
- silenced
- deagle
- shotgun
- sawed-off
- combat shotgun
- uzi
- mp5
- ak-47
- m4
- tec-9
- rifle
- sniper
- rocket launcher
- rocket launcher hs
- flamethrower
- minigun
- satchel
- bomb
- spraycan
- fire extinguisher
- camera
- 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" See Weapon 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 weapon range of the M4 at poor skill level
local range = getWeaponProperty(31, "poor", "weapon_range") outputChatBox("M4 range at poor is: "..tostring(range))
Requirements
This template will be deleted.
See Also
- getWeaponProperty
- getPickupWeapon
- getOriginalWeaponProperty
- getSlotFromWeapon
- getWeaponIDFromName
- getWeaponNameFromID
- setWeaponAmmo
- setWeaponProperty