IsWorldSpecialPropertyEnabled: Difference between revisions
Jump to navigation
Jump to search
(counterpart thing was at a wrong place) |
(added example script) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Shared function}} | ||
{{New feature/item|3.0161|1.6.0|22195|Added also as a server-side function. Previously only available as a client-side function.}} | |||
Checks if a special world property (cheat) is enabled or not. | Checks if a special world property (cheat) is enabled or not. | ||
Line 15: | Line 17: | ||
==Example== | ==Example== | ||
This code allows you to enable/disable aircars world property using /toggleAirCars command. | |||
This | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function toggleAirCars() | ||
setWorldSpecialPropertyEnabled( "aircars", not isWorldSpecialPropertyEnabled("aircars") ) | |||
end | end | ||
addCommandHandler("toggleAirCars", toggleAirCars) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{World functions}} |
Latest revision as of 21:39, 8 April 2025
Checks if a special world property (cheat) is enabled or not.
Syntax
bool isWorldSpecialPropertyEnabled ( string propname )
OOP Syntax Help! I don't understand this!
- Counterpart: setWorldSpecialPropertyEnabled
Required Arguments
- propname: the name of the property to retrieve. Possible values are listed on SetWorldSpecialPropertyEnabled.
Returns
Returns true if the property is enabled, false if it is disabled or the specified property name is invalid.
Example
This code allows you to enable/disable aircars world property using /toggleAirCars command.
function toggleAirCars() setWorldSpecialPropertyEnabled( "aircars", not isWorldSpecialPropertyEnabled("aircars") ) end addCommandHandler("toggleAirCars", toggleAirCars)
See Also
- 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