Hello once again, people.
I am a coder (Moderately new to lua), and I am currently working on custom content for a TTT server.
My goal is to make a message display of your killer after you die. (Both the name and side of your killer.)
Here is what I have so far:
[lua]function killerName(victim,inflictor,killer,team)
victim:PrintMessage(HUD_PRINTCENTER, ""..killer:Nick().." killed you!\n".."He was a "..team().."!\n")
end
hook.Add("PlayerDeath","informTheVictims",killerName)
[/lua]
It may seem correct at first, but when you look closely at the TTT scripts, they show that there are two teams - Terrorists and Spectators.
My question is - What do I put in that code instead of team(), so that it displays whether he/she was a traitor or not, and how do I make the admin names on the scoreboard red instead of gold? I would also like to know how to add a VIP class so that people can buy VIP and enjoy new privileges.
Thank you.
[highlight](User was banned for this post ("Wrong section" - mahalis))[/highlight]
Besides the fact it's incredibly imbalanced because it removes the ability to get shanked and not know your killer... That being said, look up how TTT assigns traitors.
I believe TTT does not send the traitor status to anyone but the traitors so you have no way of knowing (from the client) who is what. Because of this, when the player died, you'd have to have the server send the client (in a usermessage or such) the information.
I'm sure there is a way to bypass that due to the fact that a server already uses that feature.
[lua]
local function checkteam(pl)
if pl:IsActiveTraitor() then
return "traitor"
else
return "innocent"
end
end
function killerName(victim,inflictor,killer,team)
victim:PrintMessage(HUD_PRINTCENTER, ""..killer:Nick().." killed you!\n".."He was a "..checkteam(killer).."!\n")
end
hook.Add("PlayerDeath","informTheVictims",killerName)
[/lua]
That should work.
Sorry, you need to Log In to post a reply to this thread.