Exports
The following events and exports can be used from your own scripts to interact and/or receive info from the weather script.
zoneUpdated
This event gets triggered when a zone is updated from server, contains the zone name and a table with zone info.
params:
zone:
stringdata:
tableAddEventHandler('av_weather:zoneUpdated', function(zone,data) print(zone, json.encode(data,{ indent = true})) --[[ data = { wind: number, zone: string, fog: string, windState: string, label: string, weather: string, freeze: boolean, frozenFog: string, temperature: number } ]]-- end
timeUpdated
This event gets triggered when in game time is updated.
params:
hours:
numberminutes:
numberseconds:
number
Freeze/Unfreeze Time and Weather for local player
Use this event to freeze or sync the time for a local player, useful for multicharacter, spawn scripts, houses/motel scripts, etc.
params:
state:
Booleanhours:
numberoptionalminutes:
numberoptionalweather:
stringoptionalblackout:
Booleanoptionalfog:
stringoptionalsnow:
booleanoptional
getZone()
Use this export to get the current zone where the player is standing.
returns:
zone:
table
wind:
floatzone:
stringweather:
stringlabel:
stringtemperature:
numberfog:
string
getBlackout()
Use this export to retrieve the current blackout state.
returns:
state: B
oolean
setRain()
Removes rain effects from the player, useful for those using YMAPs where rain comes through the roof creating puddles inside their map.
params:
state:
Boolean
generateWeathers()
Use this export to generate random weathers for all zones.
getZone()
Retrieve a zone info.
parameters:
name:
string
updateZone()
Not recommended, use the weather menu instead.
parameters:
zone:
stringweather:
stringfreeze:
boolean
updateTime()
Not recommended, use the weather menu instead.
parameters:
hour:
numberminutes:
numberfreeze:
booleaninstant:
boolean
setBlackout()
Change the blackout state for all server players.
parameters:
state:
Boolean
getBlackout()
Get the server blackout state.
returns
state:
Boolean
getTime()
Get server time.
returns
value:
table
Last updated