-
Notifications
You must be signed in to change notification settings - Fork 2
/
mood.lua
147 lines (99 loc) · 3.21 KB
/
mood.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
-- Weather
local weatherType = "FOGGY"
local currentMood = nil
-- Disable normal peds
AddEventHandler('populationPedCreating', function(x, y, z, model, overrideCalls)
overrideCalls.setModel(71929310) --clown model hash disables peds? wtf
end)
local fireIntensity = 5.0
local fireOffsetX = 870.97
local fireOffsetY = -527.44
local fireOffsetZ = 57.0
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
-- Disabled wanted level
SetPlayerWantedLevel(PlayerId(), 0, false)
SetPlayerWantedLevelNow(PlayerId(), true)
-- No ambient ped spawning
SetPedDensityMultiplierThisFrame(0.0)
SetVehicleDensityMultiplierThisFrame(0.0)
SetParkedVehicleDensityMultiplierThisFrame(0.0)
SetPedShootRate(GetPlayerPed(-1), 0)
DisableFirstPersonCamThisFrame()
--Fire glows
DrawLightWithRangeAndShadow(
fireOffsetX, --X
fireOffsetY, --Y
fireOffsetZ, --Z
255, --RED
60, --GREEN
5, --BLUE
5.00, --RANGE
fireIntensity, --INTENSITY
50.00) --SHADOW
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(100)
-- Disable ambient sounds
StartAudioScene("CHARACTER_CHANGE_IN_SKY_SCENE")
-- Make it windy, cool I guess
SetWind(1000.0)
-- No power
SetBlackout(true)
-- Hide the radar
DisplayRadar(false)
if currentMood ~= nil then
ClearOverrideWeather()
ClearWeatherTypePersist()
SetWeatherTypePersist(currentMood.Weather)
SetWeatherTypeNow(currentMood.Weather)
SetWeatherTypeNowPersist(currentMood.Weather)
NetworkOverrideClockTime(currentMood.Hour, 0, 0)
SetTimecycleModifier(currentMood.Look)
SetTimecycleModifierStrength(currentMood.Intensity)
end
end
end)
local fireCoords = vec3(878.30, -512.88, 59.00)
Citizen.CreateThread(function()
while true do
Citizen.Wait(100)
fireOffsetX = fireCoords.x+math.random()*1
fireOffsetY = fireCoords.y+math.random()*1
fireOffsetZ = fireCoords.z+math.random()*1
fireIntensity = 3+math.random()*1
end
end)
function CreateFire()
local particleDictionary = "core"
local particleName = "fire_wrecked_car"
RequestNamedPtfxAsset(particleDictionary)
while not HasNamedPtfxAssetLoaded(particleDictionary) do
Citizen.Wait(0)
end
UseParticleFxAssetNextCall(particleDictionary)
StartParticleFxLoopedAtCoord(particleName, fireCoords, 0.00, 0.00, 0.00, 1.00, 0, 0, 0, 0)
StartScriptFire(fireCoords, 25, false)
end
CreateFire()
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
--StartParticleFxLoopedAtCoord("fire_wrecked_car", 870.97, -527.44, 56.89, 0.0, 0.0, 0.0, 100.0, false, false, false, 0)
--StartScriptFire(870.97, -527.44, 56.89, 25, false)
end
end)
function UpdateMood( newMood )
currentMood = newMood
end
AddEventHandler('factions:updateMood', function(newMood)
currentMood = newMood
end)
AddEventHandler("factions:cl_onResetRound", function(RoundInfo)
print("Setting New Mood")
currentMood = RoundInfo.CurrentMood
end)
RegisterNetEvent("factions:cl_onResetRound")