ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getWeaponProperty

Function

getWeaponProperty

ServerWeaponsIdentical to MTA:SA

Returns a weapon property (e.g. damage, range) set on this server with setWeaponProperty.

Syntax

mixed getWeaponProperty(string/int weaponOrId, string skillOrProperty [, string property = nil])

Arguments

weaponOrIdstring/int
Weapon name or ID.
skillOrPropertystring
Skill level ("poor", "std", "pro") or the property name directly.
propertystring, optional = nil
Property name when the second argument was a skill level.

Returns

The property value, or false if not set.

Example

local dmg = getWeaponProperty("m4", "pro", "damage")
print(dmg or "domyślne")

See also