SetJetpackWeaponEnabled
Jump to navigation
Jump to search
This function sets a weapon usable while using the Jetpack.
Syntax
bool setJetpackWeaponEnabled ( int weaponID/string weaponName, bool enabled )
Required Arguments
- weaponID/weaponName: The ID or weapon name 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 boolean representing whether the weapon is enabled or disabled.
Returns
Returns true if successful, or false if invalid arguments are passed.
Example
This example enables the M4 to be fired while using a jetpack and announces it in the chat.
addEventHandler("onResourceStart",resourceRoot,function() if setJetpackWeaponEnabled("31",true) then outputChatBox(getWeaponNameFromID(31).." is now enabled for jetpacks!") end end)
This example enables the M4, sniper rifle and country rifle to be fired while using a jetpack and announces it in the chat.
local weapons = { 31, 34, 33, } addEventHandler("onResourceStart",resourceRoot,function() for i,v in ipairs(weapons) do if setJetpackWeaponEnabled(v,true) then outputChatBox(getWeaponNameFromID(v).." is now enabled for jetpacks!") end end end )
See Also
- getJetpackWeaponEnabled
- setJetpackWeaponEnabled
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel