SetJetpackWeaponEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 14: Line 14:


==Example==  
==Example==  
<syntaxhighlight lang="lua">addCommandHandler("setJPEnabled",function(ped,_,wep,enabled)
{{Example}}
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)</syntaxhighlight>
==Requirements==
==Requirements==
{{Requirements|1.3.1|n/a|}}
{{Requirements|1.3.1|n/a|}}
==See Also==
==See Also==
{{World_functions}}
{{World_functions}}

Revision as of 18:56, 18 July 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

Accessories-text-editor.png Script Example Missing Function SetJetpackWeaponEnabled needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.
-- TODO

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