diff --git a/client.lua b/client.lua index 3b2844a..32db1b0 100644 --- a/client.lua +++ b/client.lua @@ -27,6 +27,9 @@ local Menu = config.Menu local CinematicHeight = 0.2 local w = 0 local radioActive = false +local talking = 0 +local radioChannel = 0 +local voice = 0 DisplayRadar(false) @@ -711,10 +714,18 @@ CreateThread(function() oxygen = GetPlayerUnderwaterTimeRemaining(playerId) * 10 end -- Player hud - local talking = NetworkIsPlayerTalking(playerId) - local voice = 0 - if LocalPlayer.state['proximity'] then - voice = LocalPlayer.state['proximity'].distance + if GetResourceState(Config.TokoResource) == "started" then + talking = exports[Config.TokoResource]:getPlayerData(GetPlayerServerId(PlayerId()), "voip:talking") or 0 + else + talking = NetworkIsPlayerTalking(playerId) + end + + if GetResourceState(Config.TokoResource) == "started" then + voice = exports[Config.TokoResource]:getPlayerData(GetPlayerServerId(PlayerId()), "voip:mode") or 0 + else + if LocalPlayer.state['proximity'] then + voice = LocalPlayer.state['proximity'].distance + end end if IsPauseMenuActive() then show = false @@ -760,6 +771,52 @@ CreateThread(function() showAltitude = true showSeatbelt = false end + if GetResourceState(Config.TokoResource) == "started" then + radioChannel = exports[Config.TokoResource]:getPlayerData(GetPlayerServerId(PlayerId()), "radio:channel") or 0 + else + radioChannel = LocalPlayer.state['radioChannel'] + end + + if not (IsPedInAnyVehicle(player) and not IsThisModelABicycle(vehicle)) then + updatePlayerHud({ + show, + Menu.isDynamicHealthChecked, + Menu.isDynamicArmorChecked, + Menu.isDynamicHungerChecked, + Menu.isDynamicThirstChecked, + Menu.isDynamicStressChecked, + Menu.isDynamicOxygenChecked, + Menu.isDynamicEngineChecked, + Menu.isDynamicNitroChecked, + GetEntityHealth(player) - 100, + playerDead, + GetPedArmour(player), + thirst, + hunger, + stress, + voice, + radioChannel, + talking, + armed, + oxygen, + parachute, + -1, + cruiseOn, + nitroActive, + harness, + hp, + math.ceil(GetEntitySpeed(vehicle) * speedMultiplier), + -1, + Menu.isCinematicModeChecked, + dev, + radioActive, + }) + end + -- Vehicle hud + if IsPedInAnyHeli(player) or IsPedInAnyPlane(player) then + showAltitude = true + showSeatbelt = false + end if IsPedInAnyVehicle(player) and not IsThisModelABicycle(vehicle) then if not wasInVehicle then DisplayRadar(true) @@ -786,7 +843,7 @@ CreateThread(function() hunger, stress, voice, - LocalPlayer.state['radioChannel'], + radioChannel, talking, armed, oxygen, diff --git a/config.lua b/config.lua index 5daf3b9..8610e77 100644 --- a/config.lua +++ b/config.lua @@ -6,6 +6,7 @@ Config.MinimumStress = 50 -- Minimum Stress Level For Screen Shaking Config.MinimumSpeedUnbuckled = 50 -- Going Over This Speed Unbuckled Will Cause Stress Config.MinimumSpeed = 100 -- Going Over This Speed While Buckled Will Cause Stress Config.DisableStress = false -- If true will disable stress completely for all players +Config.TokoResource = 'tokovoip_script' -- If TokoVoIP is found it will use it to determine if the player is talking -- Stress Config.WhitelistedWeaponArmed = { -- Disable showing armed icon from weapons in this table