Client Events/Exports

Note: This events are all registered in the client side and will only affect the player target.

  • Freeze/Unfreeze player weather and time:

-- TriggerEvent('av_weather:freeze', state, hours, minutes, weather, blackout)
-- state: boolean (true/false) (enable/disable sync)
-- hours: number (replace current hour)
-- minutes: number (replace current minutes)
-- weather: string (replace current weather)
-- blackout: boolean (enable/disable blackout)
local state = true
local hours = 23
local minutes = 00
local weather = "CLEAR"
local blackout = false

TriggerEvent('av_weather:freeze',state, hours, minutes, weather, blackout)

-- To sync the player with server, trigger the event again and only send state as false:
  • Get the blackout state

-- Returns boolean
local state = exports['av_weather']:GetBlackoutState()
  • Remove rain effects (perfect for ymaps), an example can be found here: AV StopRain

exports['av_weather']:setRain(false) -- this will remove rain effects in client
exports['av_weather']:setRain(true) -- this will sync the rain effects with server

Last updated