Author Topic: Death display  (Read 1683 times)

0 Members and 1 Guest are viewing this topic.

Offline Suicidal Dog

  • Newbie
  • *
  • Posts: 14
  • Karma: -1
Death display
« on: February 13, 2017, 12:46:20 PM »
Hi, I am currently making a small but nice little addon for a server where a little display comes up at the centre bottom of their screen upon dying. Now this display is supposed to show a message at the top to show the name of the killer with their name. It is then supposed to show the weapon they were killed with and some extra stuff I can do myself. The problem I am having is with calling the players killers name and the weapon, I have no idea how to go about this and just want some help with how to go about getting the name and weapon and making them into not sure what this is but a "killer = killersname" and "killingweapon = killersweapon". Just so I can display those in a msg on the display. When you post a reply with some support, if you're giving some code that I can use could I get a full explanation as I wanna know how it works and see if I have any future application for future projects. The only real thing you guys needed was that as the code I have is currently just a little vgui and I doubt it'll be very helpful.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Death display
« Reply #1 on: February 13, 2017, 12:52:13 PM »
GM:PlayerDeath

That's probably the best place to look. It takes the player (victim), weapon (inflictor), and the killer (attacker), as arguments.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Suicidal Dog

  • Newbie
  • *
  • Posts: 14
  • Karma: -1
Re: Death display
« Reply #2 on: February 13, 2017, 02:45:14 PM »
How would I use this as I tried that before and removed it due to it just giving the error of "attempt to index GM(a nil value)" If you would mind could you give me an example of it as I have no clue about how to use that. Since before I had a complaint from someone for not asking, could you write an example of it being used in a VGui panel or just what I would actually need. I'm not completely brain dead and can put in variables into panel.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given