SetJetpackWeaponEnabled

From Multi Theft Auto: Wiki
Revision as of 19:38, 10 July 2012 by Jaysds (talk | contribs) (Created page with "__NOTOC__ {{Server function}} This function sets a weapon usable while using the Jetpack. ==Syntax== <syntaxhighlight lang="lua">bool setJetpackWeaponEnabled(weapon-Type, player thePlayer)</...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function sets a weapon usable while using the Jetpack.

Syntax

bool setJetpackWeaponEnabled(weapon-Type, player thePlayer)

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

addCommandHandler("setJPEnabled",function(ped,_,wep,enabled)
	if type(wep) == "number" then
		wep = getWeaponNameFromID(wep)
	end
	if enabled == "true" then
		setJetpackWeaponEnabled(wep,true)
		outputChatBox("You just enabled the Jetpack Weapons.",ped)
	elseif enabled == "false" then
		setJetpackWeaponEnabled(wep,false)
		outputChatBox("You just disabled the Jetpack Weapons.",ped)
	else
		outputChatBox("SYNTAX: '/setJPEnabled theWeapon enabled"
	end
end)

Requirements

This template will be deleted.

See Also