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

Function

setWeaponState

ServerWeaponsIdentical to MTA:SA

Sets a scripted weapon's state.

Syntax

bool setWeaponState(weapon weapon, string state)

Arguments

weaponweapon
The scripted weapon.
statestring
"ready", "firing" or "reloading".

Returns

true on success, false for an unknown state.

Example

setWeaponState(turret, "firing")
setTimer(setWeaponState, 3000, 1, turret, "ready")

See also