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
  • 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)
  • 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')
    print('wrong zone name?')
  • 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
  • Trigger Blackout:

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

-- Returns boolean
  • Get server time:


Last updated