IsWorldSpecialPropertyEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Removed really weird and nonsense example)
(added example script)
 
Line 17: Line 17:


==Example==
==Example==
{{Needs Example}}
This code allows you to enable/disable aircars world property using /toggleAirCars command.
<syntaxhighlight lang="lua">
function toggleAirCars()
    setWorldSpecialPropertyEnabled( "aircars", not isWorldSpecialPropertyEnabled("aircars") )
end
addCommandHandler("toggleAirCars", toggleAirCars)
</syntaxhighlight>


==See Also==
==See Also==
{{World functions}}
{{World functions}}

Latest revision as of 21:39, 8 April 2025

ADDED/UPDATED IN VERSION 1.6.0 r22195:
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.

Syntax

bool isWorldSpecialPropertyEnabled ( string propname )

OOP Syntax Help! I don't understand this!

Counterpart: setWorldSpecialPropertyEnabled


Required Arguments

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