Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 08:31:24 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: You were killed by_____
Pages: [1]
Author Topic: You were killed by_____  (Read 4668 times)
Vegi
Poster

Posts: 17


Fuck yeah


« on: December 19, 2010, 03:41:55 AM »

Ok, this is just a basic suggestion. i looked on the console commands and i didnt see something that does this. I think it should show who you were killed by when you die. it already does on the server i play on usually, but on a lot of other ones, it doesnt. basically just it says you were killed by *name here*. He was a *traitor/detective/innocent*. much easier to figure out if you were rdmed.
hayhay89
Poster

Posts: 100


« Reply #1 on: December 19, 2010, 06:33:02 AM »

much easier to figure out if you were rdmed.


Really? a Admin can do ttt_print_damagelog And its all there.
Or better yet wait till end of round and go to the Round report Its not rocket science People.
EpicBox
Poster

Posts: 165


ZE EPIC BAWKZ IZ CUMING FOR YA.


« Reply #2 on: December 19, 2010, 01:58:27 PM »

Heh I like the idea, the text would appear in the center of the screen with the classic "Law & Order" sound effect (DOINK DOINK).

Here's the sound <.<
http://www.youtube.com/watch?v=1OlCVNn9ZeY
« Last Edit: December 19, 2010, 01:59:37 PM by EpicBox »

There's 3 things I hate: <br />People that hates people.<br />People that hates the haters.<br />And people that hates the haters of the haters.
StormX
Poster

Posts: 69


« Reply #3 on: December 20, 2010, 02:44:42 AM »

local function checkteam(pl)
   if pl:IsActiveTraitor() then
       return "TRAITOR"
   else
       return "INNOCENT"
   end
end

function whokilled(pl,dmg,kl,x)
   pl:SendLua("print('You were killed by '..kl:Name()..'['..checkteam(kl)..']'"))
end

hook.Add( "PlayerDeath", "TTTDeath", whokilled)

someone asked for some help on this @ fp so posted here
Charles445
Build Tester
*
Posts: 2338


I LOVE THIS AVATAR


« Reply #4 on: December 20, 2010, 03:43:24 PM »

I can't see any immediate problems with this.
Also, nice hook.

del>Ok, so Bad King, you are just going to wait for Garry to fix?
What an idiotic thing to ask. Dammit weed.

Bookcases, Bookcases Everywhere
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #5 on: December 20, 2010, 03:50:53 PM »

other than it makes a lua error. Look at the quotes.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #6 on: December 20, 2010, 03:57:33 PM »

Consider ply:GetRoleString()
Raneman
Poster

Posts: 219

Shitposter


« Reply #7 on: December 22, 2010, 12:50:13 AM »

Wow, lua doesn't look that hard. Maybe because I just learned Python.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #8 on: December 22, 2010, 07:52:50 PM »

(lua/autorun/server/filename.lua)Serverside:

hook.Add("PlayerDeath", "Who Killed You", function(vic, infl, att)
  if (att:IsPlayer() && vic:IsPlayer()) then
     vic:PrintMessage(HUD_PRINTTALK, "You were killed by "..att:Nick().." ["..att:GetRoleString().."!]")
  end
end)

hook.Add("PlayerDeath", "Who You Killed", function(vic, infl, att)
  if (att:IsPlayer() && vic:IsPlayer()) then
     att:PrintMessage(HUD_PRINTTALK, "You killed "..vic:Nick().." ["..vic:GetRoleString().."]")
  end
end)


This is already on my server(CyberGmod.net TTT server).

Thanks to BKU for helping me with a few GModdish issues.(Failing if i specify the code outside the hook, aka, calling a function on death, so i had to put it inside a hook, silly, i know, but it worked..)

I was trying something with umsg's for chat coloring, but i don't think that its needed that much.

Basically, this will tell you who killed you, when you die and what role they were. It also tells the killer the name of the person they killed. You don't really need that, but you can have it as an extra if you want it. If not, remove the second hook.
« Last Edit: December 22, 2010, 07:57:09 PM by phoenixf129 »

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: You were killed by_____ « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.01 seconds with 18 queries.