Skip to content

Commit

Permalink
fix(menu): ptfx convar sync (closes #527)
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Dec 19, 2021
1 parent 3819d8a commit 5483a86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions scripts/menu/client/cl_player_mode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,11 @@ RegisterNUICallback('playerModeChanged', function(mode, cb)
end)

-- [[ Player mode changed cb event ]]
RegisterNetEvent('txAdmin:menu:playerModeChanged', function(mode)
createPlayerModePtfxLoop()
RegisterNetEvent('txAdmin:menu:playerModeChanged', function(mode, ptfx)
if ptfx then
createPlayerModePtfxLoop()
end

if mode == 'godmode' then
toggleFreecam(false)
toggleGodMode(true)
Expand Down
2 changes: 1 addition & 1 deletion scripts/menu/server/sv_player_mode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RegisterNetEvent('txAdmin:menu:playerModeChanged', function(mode, nearbyPlayers)
local allow = PlayerHasTxPermission(src, 'players.playermode')
TriggerEvent("txaLogger:menuEvent", src, "playerModeChanged", allow, mode)
if allow then
TriggerClientEvent('txAdmin:menu:playerModeChanged', src, mode)
TriggerClientEvent('txAdmin:menu:playerModeChanged', src, mode, not IS_PTFX_DISABLED)

if not IS_PTFX_DISABLED then
for _, v in ipairs(nearbyPlayers) do
Expand Down

0 comments on commit 5483a86

Please sign in to comment.