SetJetpackWeaponEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(function weaponEnabled () setJetpackWeaponEnabled ( 27, true ) end addCommandHandler ("enableSpas12", weaponEnabled))
Line 14: Line 14:


==Example==
==Example==
<syntaxhighlight lang="lua">addEventHandler("onResourceStart",resourceRoot,function()
    if setJetpackWeaponEnabled("31",true) then
          outputChatBox(getWeaponNameFromID(31).." is now enabled for jetpacks!")
    end
end)</syntaxhighlight>


==Requirements==
==Requirements==

Revision as of 17:11, 25 September 2012

This function sets a weapon usable while using the Jetpack.

Syntax

bool setJetpackWeaponEnabled(string weapon, bool enabled)

Required Arguments

  • weapon The weapon that's being set usable on a Jetpack.
  • 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)

Requirements

This template will be deleted.

See Also