Hi everyone, i need help please !
I want to create a script for set Blackout by zone but i dont know how to do that… I have take vSync ressource for see what value set blackout. I’ve find this in code :
CLIENT SCRIPT:
Citizen.CreateThread(function()
while true do
if lastWeather ~= CurrentWeather then
lastWeather = CurrentWeather
SetWeatherTypeOverTime(CurrentWeather, 15.0)
Citizen.Wait(15000)
end
Citizen.Wait(100) -- Wait 0 seconds to prevent crashing.
SetBlackout(blackout)
ClearOverrideWeather()
ClearWeatherTypePersist()
SetWeatherTypePersist(lastWeather)
SetWeatherTypeNow(lastWeather)
SetWeatherTypeNowPersist(lastWeather)
if lastWeather == 'XMAS' then
SetForceVehicleTrails(true)
SetForcePedFootstepsTracks(true)
else
SetForceVehicleTrails(false)
SetForcePedFootstepsTracks(false)
end
end
end)
SERVER SCRIPT :
local blackout = true
AddEventHandler('vSync:requestSync', function()
TriggerClientEvent('vSync:updateWeather', -1, CurrentWeather, blackout)
TriggerClientEvent('vSync:updateTime', -1, baseTime, timeOffset, freezeTime)
end)
RegisterCommand('blackout', function(source)
if source == 0 then
blackout = not blackout
if blackout then
print("Blackout is now enabled.")
else
print("Blackout is now disabled.")
end
else
if isAllowedToChange(source) then
blackout = not blackout
if blackout then
TriggerClientEvent('vSync:notify', source, 'Blackout is now ~b~enabled~s~.')
else
TriggerClientEvent('vSync:notify', source, 'Blackout is now ~r~disabled~s~.')
end
TriggerEvent('vSync:requestSync')
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(300000)
TriggerClientEvent('vSync:updateWeather', -1, CurrentWeather, blackout)
end
end)
For moment, scipt work like this :
Blackout is always active , when i write “/blackout” blackout set off
I want script do this :
Blackout always active on all the map but, some zone have blackout set off.
I have 2 question. First, how can i set zone for blackout off ? 2nd, When blackout is on, is disable car light … How enable car light when blackout on ?
Sorry for my English, thanks for the attention, best regards