Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 62 additions & 5 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Comment on lines +717 to +728
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put in one check? Also, just check if GetResourceState("tokovoip_script") == "started" then do that else do this

if GetResourceState(Config.TokoResource) == "started" then
    talking = exports[Config.TokoResource]:getPlayerData(GetPlayerServerId(PlayerId()), "voip:talking") or 0
    voice = exports[Config.TokoResource]:getPlayerData(GetPlayerServerId(PlayerId()), "voip:mode") or 0
else
    if LocalPlayer.state['proximity'] then
        voice = LocalPlayer.state['proximity'].distance
    end
    talking = NetworkIsPlayerTalking(playerId)
end

end
if IsPauseMenuActive() then
show = false
Expand Down Expand Up @@ -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)
Expand All @@ -786,7 +843,7 @@ CreateThread(function()
hunger,
stress,
voice,
LocalPlayer.state['radioChannel'],
radioChannel,
talking,
armed,
oxygen,
Expand Down
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this a bool to check if Tokovoip is started then it runs tokovoip stuff else, it will default to normal.


-- Stress
Config.WhitelistedWeaponArmed = { -- Disable showing armed icon from weapons in this table
Expand Down