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 anythingexports['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/falselocal zone ="santos"local weather ="RAIN"local freeze =falselocal res = exports['av_weather']:UpdateZone(zone,weather,freeze)if res thenprint('weather modified')elseprint('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 waylocal hours =20local minutes =00local freeze =falselocal instant =falseexports['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 =trueexports['av_weather']:SetBlackout(status)