- Documentation
- Server functions
- setWorldSpecialPropertyEnabled
Function
setWorldSpecialPropertyEnabled
Turns a special world property on or off: hovercars, aircars, extrabunny, extrajump, randomfoliage, snipermoon, extraairresistance, underworldwarp, vehiclesunglare, coronaztest, watercreatures, burnflippedcars, fireballdestruct, roadsignstext, extendedwatercannons, tunnelweatherblend, ignorefirestate, flyingcomponents, vehicleburnexplosions, vehicle_engine_autostart. vehicle_engine_autostart really works: turned off, a car engine does not start by itself when a driver gets in and must be turned on with setVehicleEngineState.
Syntax
bool setWorldSpecialPropertyEnabled(string property, bool enabled)Arguments
propertystring- Property name from the list above.
enabledbooltrue= enabled.
Returns
true on success, false for an unknown name.
Example
setWorldSpecialPropertyEnabled("vehicle_engine_autostart", false)
addCommandHandler("silnik", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle then setVehicleEngineState(vehicle, not getVehicleEngineState(vehicle)) end
end)
Notes
Limitation. Apart from vehicle_engine_autostart, properties are only stored for scripts; the game does not apply them yet.
See also
isWorldSpecialPropertyEnabledReturns whether a special world property is enabled: the value fromsetWorldSpecialPropertyEnabledor the default (e.g.randomfoliageandvehicle_engine_autostarton by default,hovercarsoff).setVehicleEngineStateTurns a vehicle's engine on or off for every player. With the engine off the vehicle does not drive even when the driver presses the throttle (it can only roll). By default the engine starts by itself when a driver gets in; aftersetWorldSpecialPropertyEnabled("vehicle_engine_autostart", false)it does not, and an RP server can build its own ignition on a key or command.