Skip to content

Commit

Permalink
fix stress
Browse files Browse the repository at this point in the history
  • Loading branch information
Tnnuy-sv authored Apr 5, 2021
1 parent dc8a84b commit ceb8b28
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions server-data/resources/[MS]/ms-hud/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end)
RegisterNetEvent("MSCore:Client:OnPlayerUnload")
AddEventHandler("MSCore:Client:OnPlayerUnload", function()
isLoggedIn = false
QBHud.Show = false
msHud.Show = false
SendNUIMessage({
action = "hudtick",
show = true,
Expand All @@ -42,7 +42,7 @@ end)
RegisterNetEvent("MSCore:Client:OnPlayerLoaded")
AddEventHandler("MSCore:Client:OnPlayerLoaded", function()
isLoggedIn = true
QBHud.Show = true
msHud.Show = true
PlayerJob = MSCore.Functions.GetPlayerData().job
end)

Expand Down Expand Up @@ -106,7 +106,7 @@ Citizen.CreateThread(function()
StressGain = math.ceil(StressGain)
if StressGain > 0 then
MSCore.Functions.Notify('Gained stress', "primary", 2000)
TriggerServerEvent('qb-hud:Server:UpdateStress', StressGain)
TriggerServerEvent('ms-hud:Server:UpdateStress', StressGain)
StressGain = 0
end
end
Expand Down
4 changes: 2 additions & 2 deletions server-data/resources/[MS]/ms-hud/client/money.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AddEventHandler("hud:client:SetMoney", function()
bankAmount = PlayerData.money["bank"]
end
end)
if QBHud.Money.ShowConstant then
if msHud.Money.ShowConstant then
SendNUIMessage({
action = "open",
cash = cashAmount,
Expand All @@ -36,7 +36,7 @@ AddEventHandler("hud:client:OnMoneyChange", function(type, amount, isMinus)
bankAmount = PlayerData.money["bank"]
end)

if QBHud.Money.ShowConstant then
if msHud.Money.ShowConstant then
SendNUIMessage({
action = "open",
cash = cashAmount,
Expand Down
30 changes: 15 additions & 15 deletions server-data/resources/[MS]/ms-hud/client/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end
Citizen.CreateThread(function()
Citizen.Wait(500)
while true do
if MSCore ~= nil and isLoggedIn and QBHud.Show then
if MSCore ~= nil and isLoggedIn and msHud.Show then
speed = GetEntitySpeed(GetVehiclePedIsIn(GetPlayerPed(-1), false)) * 3.6
local pos = GetEntityCoords(GetPlayerPed(-1))
local time = CalculateTimeToDisplay()
Expand Down Expand Up @@ -64,11 +64,11 @@ end)

Citizen.CreateThread(function()
while true do
if MSCore ~= nil and isLoggedIn and QBHud.Show then
if MSCore ~= nil and isLoggedIn and msHud.Show then
if IsPedInAnyVehicle(GetPlayerPed(-1), false) then
speed = GetEntitySpeed(GetVehiclePedIsIn(GetPlayerPed(-1), false)) * 3.6
if speed >= QBStress.MinimumSpeed then
TriggerServerEvent('qb-hud:Server:GainStress', math.random(1, 2))
TriggerServerEvent('ms-hud:Server:GainStress', math.random(1, 2))
end
end
end
Expand All @@ -80,7 +80,7 @@ local radarActive = false
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
if IsPedInAnyVehicle(PlayerPedId()) and isLoggedIn and QBHud.Show then
if IsPedInAnyVehicle(PlayerPedId()) and isLoggedIn and msHud.Show then
DisplayRadar(true)
SendNUIMessage({
action = "car",
Expand Down Expand Up @@ -133,16 +133,16 @@ AddEventHandler("seatbelt:client:ToggleSeatbelt", function(toggle)
end
end)

RegisterNetEvent('qb-hud:client:ToggleHarness')
AddEventHandler('qb-hud:client:ToggleHarness', function(toggle)
RegisterNetEvent('ms-hud:client:ToggleHarness')
AddEventHandler('ms-hud:client:ToggleHarness', function(toggle)
SendNUIMessage({
action = "harness",
toggle = toggle
})
end)

RegisterNetEvent('qb-hud:client:UpdateNitrous')
AddEventHandler('qb-hud:client:UpdateNitrous', function(toggle, level, IsActive)
RegisterNetEvent('ms-hud:client:UpdateNitrous')
AddEventHandler('ms-hud:client:UpdateNitrous', function(toggle, level, IsActive)
SendNUIMessage({
action = "nitrous",
toggle = toggle,
Expand All @@ -151,25 +151,25 @@ AddEventHandler('qb-hud:client:UpdateNitrous', function(toggle, level, IsActive)
})
end)

RegisterNetEvent('qb-hud:client:UpdateDrivingMeters')
AddEventHandler('qb-hud:client:UpdateDrivingMeters', function(toggle, amount)
RegisterNetEvent('ms-hud:client:UpdateDrivingMeters')
AddEventHandler('ms-hud:client:UpdateDrivingMeters', function(toggle, amount)
SendNUIMessage({
action = "UpdateDrivingMeters",
amount = amount,
toggle = toggle,
})
end)

RegisterNetEvent('qb-hud:client:UpdateVoiceProximity')
AddEventHandler('qb-hud:client:UpdateVoiceProximity', function(Proximity)
RegisterNetEvent('ms-hud:client:UpdateVoiceProximity')
AddEventHandler('ms-hud:client:UpdateVoiceProximity', function(Proximity)
SendNUIMessage({
action = "proximity",
prox = Proximity
})
end)

RegisterNetEvent('qb-hud:client:ProximityActive')
AddEventHandler('qb-hud:client:ProximityActive', function(active)
RegisterNetEvent('ms-hud:client:ProximityActive')
AddEventHandler('ms-hud:client:ProximityActive', function(active)
SendNUIMessage({
action = "talking",
IsTalking = active
Expand All @@ -178,7 +178,7 @@ end)

Citizen.CreateThread(function()
while true do
if isLoggedIn and QBHud.Show and MSCore ~= nil then
if isLoggedIn and msHud.Show and MSCore ~= nil then
MSCore.Functions.TriggerCallback('hospital:GetPlayerBleeding', function(playerBleeding)
if playerBleeding == 0 then
bleedingPercentage = 0
Expand Down

0 comments on commit ceb8b28

Please sign in to comment.