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

Function

setWeaponFlags

ServerWeaponsIdentical to MTA:SA

Sets a scripted weapon flag (name and value) or several flags at once from a table.

Syntax

bool setWeaponFlags(weapon weapon, string/table flagOrTable [, mixed value = nil])

Arguments

weaponweapon
The scripted weapon.
flagOrTablestring/table
A flag name or a { flag = value } table.
valuemixed, optional = nil
The flag value when you pass a name.

Returns

true on success.

Example

setWeaponFlags(turret, { disable_model = false, shoot_if_out_of_range = true })

See also