Hello all,
So I'm a bit stumped on this,
I've created my own lua file with a bunch of functionality I've been writing, this is the first hook I've added and it's proven to be a bit troublesome thus far, hopefully someone can provide me with insight on what the problem may be with this.
The server is running the latest version of ULX and is using the TTT gamemode, when I'm using the below functionality / hook, when a player dies, the message is being successfully sent via the hook however, it's preventing the PlayerDeath events from firing, IE, the player will die and will lose control of his character but, on the TAB menu, the player still appears to be alive and can speak in voice to other alive players.
Now, I've tried adding a 20 to the end of the hook "hook.Add( "PlayerDeath", "ULXSendPlayerDeathHook", SendPlayerDeath, 20)" and tried it in the reverse, -20 (I believe raises priority higher).
I did notice that ULX has a logger function in log.lua which also hooks PlayerDeath with a priority of -20, this functionality seems to work fine, doesn't block the base PlayerDeath events at all, so my question is, why is the below blocking the base functionality?
Any information on this will be greatly appreciated.
Thank you all.
local CATEGORY_NAME = "Utility"
------------------------------ Hook PlayerDeath ------------------------------
local function SendPlayerDeath( victim, weapon, killer )
victim:PrintMessage( HUD_PRINTTALK, string.format( "(%s)%s killed you", killer:GetRoleString(), killer:Nick() ) )
end
hook.Add( "PlayerDeath", "ULXSendPlayerDeathHook", SendPlayerDeath )