AddEventHandler("framework:gangs:onGangChange", function(playerId, gang)
local group = exports.killfeed:GetPlayerGroup(playerId)
if group then
exports.killfeed:RemovePlayerFromGroup(playerId, group)
end
exports.killfeed:AddPlayerToGroup(playerId, gang)
end)
Using the OverwriteNextDeath function
OverwriteNextDeath is a client-side function that is used to overwrite the next death, this should be used when a script kills the player, for example when they starve to death etc.
If you don't overwrite the next death and kill them through a script it'll display as if they fell to death (GTA does this).
Example:
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
if hunger > 0 then
hunger = hunger - 100
else
local playerPed = PlayerPedId()
local health = GetEntityHealth(playerPed)
if health <= 10 then
exports.killfeed:OverwriteNextDeath('starvation')
SetEntityHealth(playerPed, 0)
else
SetEntityHealth(playerPed, health - 10)
end
end
end
end)