Skip to content

Conversation

@GamingLuke1337
Copy link

Description

This PR adds support for TokoVoIP. It would be a nice-to-have Integration.

i can also add another config option for diasbling this check, if required.

Checklist

  • I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • My code fits the style guidelines.
  • My PR fits the contribution guidelines.

@GamingLuke1337
Copy link
Author

linting check is happy now :)

Copy link
Contributor

@ChristianBDev ChristianBDev left a comment

Choose a reason for hiding this comment

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

Fix changes, if need assistance I will assist

Comment on lines +717 to +728
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
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

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.

@ChristianBDev
Copy link
Contributor

Better yet I believe should suffice instead of adding a config option, but dont think the hud should allow this, more of a change on your side for a server

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants