Server Exports

All this exports needs to be triggered server side:

  • Generate new weathers for all zones (LS, Paleto, Sandy and Cayo Perico):

-- No args are needed
-- It doesn't return anything
exports['av_weather']:GenerateWeathers()
  • Get a specific zone weather:

-- exports['av_weather']:GetZone(name)
-- Needs a zone name ("santos", "paleto", "sandy" or "cayo")
-- Returns a table: {zone, weather, frozen status (boolean)}
local name = "santos"
local res = exports['av_weather']:GetZone(name)
print(json.encode(res))
  • Update a specific zone weather:

-- exports['av_weather']:UpdateZone(zone,weather,freeze)
-- returns true/false
local zone = "santos"
local weather = "RAIN"
local freeze = false
local res = exports['av_weather']:UpdateZone(zone,weather,freeze)
if res then
    print('weather modified')
else
    print('wrong zone name?')
end
  • Update day time:

-- exports['av_weather']:UpdateTime(hours,minutes,freeze,instant)
-- This example will update the server time to 22:00
-- freeze option will freeze the time server side untill you remove it
-- instant will change the time instantly instead of doing it in a more natural way
local hours = 20
local minutes = 00
local freeze = false
local instant = false
exports['av_weather']:UpdateTime(hours,minutes,freeze,instant)
  • Trigger Blackout:

-- Trigger blackout server side, it won't remove the vehicle lights
-- exports['av_weather']:SetBlackout(status)
local status = true
exports['av_weather']:SetBlackout(status)
  • Get Blackout state:

-- Returns boolean
exports['av_weather']:GetBlackoutState()
  • Get server time:

exports['av_weather']:GetTime()

Last updated