SetJetpackWeaponEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 20: Line 20:
     end
     end
end)</syntaxhighlight>
end)</syntaxhighlight>
== Issues ==
{{Issues|
{{Issue|8827|If you use setJetpackWeaponEnabled to make weapons usable on jetpack and then wield them on jetpack, the weapon can become invisible.}}
}}


==Requirements==
==Requirements==

Revision as of 15:08, 21 April 2015

This function sets a weapon usable while using the Jetpack.

[[{{{image}}}|link=|]] Note: colt 45, sawed-off, tec-9 and uzi are always enabled for the Jetpack and are not affected by this function

Syntax

bool setJetpackWeaponEnabled(string weapon, bool enabled)

Required Arguments

  • weapon The weapon that's being set usable on a Jetpack. Names can be: (Case is ignored)
  • brassknuckle
  • golfclub
  • nightstick
  • knife
  • bat
  • shovel
  • poolstick
  • katana
  • chainsaw
  • dildo
  • vibrator
  • flower
  • cane
  • 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
  • nightvision
  • infrared
  • parachute
  • enabled A bool representing whether the weapon is enabled or disabled.

Returns

Returns true, else false if invalid arguments are passed.

Example

addEventHandler("onResourceStart",resourceRoot,function()
     if setJetpackWeaponEnabled("31",true) then
          outputChatBox(getWeaponNameFromID(31).." is now enabled for jetpacks!")
     end
end)

Issues

Issue ID Description
#8827 If you use setJetpackWeaponEnabled to make weapons usable on jetpack and then wield them on jetpack, the weapon can become invisible.

Requirements

Minimum server version 1.3.1
Minimum client version n/a

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.3.1" />

See Also