Skip to content

Commit

Permalink
feat(server/main.lua): Replicate isDead to statebag (#73)
Browse files Browse the repository at this point in the history
The isDead statebag is used by pma-voice to disable the radio.
(it could also be used for other things i guess)
  • Loading branch information
TonybynMp4 authored Feb 7, 2024
1 parent def08b1 commit d2baaee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ AddStateBagChangeHandler(DEATH_STATE_STATE_BAG, nil, function(bagName, _, value)
local player = exports.qbx_core:GetPlayer(playerId)
player.Functions.SetMetaData('isdead', value == sharedConfig.deathState.DEAD)
player.Functions.SetMetaData('inlaststand', value == sharedConfig.deathState.LAST_STAND)
Player(playerId).state:set("isDead", value == sharedConfig.deathState.DEAD or value == sharedConfig.deathState.LAST_STAND, true)
end)

---@param player table|number
Expand Down

0 comments on commit d2baaee

Please sign in to comment.