ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setWorldSpecialPropertyEnabled

Function

setWorldSpecialPropertyEnabled

ServerWorldIdentical to MTA:SA

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.
enabledbool
true = 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