Ulysses
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
Ulysses
»
General
»
Developers Corner
»
How can I get the weapon used when you damage someone.
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: How can I get the weapon used when you damage someone. (Read 2266 times)
0 Members and 1 Guest are viewing this topic.
Deathtitan77
Jr. Member
Posts: 63
Karma: 6
How can I get the weapon used when you damage someone.
«
on:
June 18, 2013, 08:55:15 AM »
How can I do that?
Logged
Megiddo
Ulysses Team Member
Hero Member
Posts: 6214
Karma: 394
Project Lead
Re: How can I get the weapon used when you damage someone.
«
Reply #1 on:
June 18, 2013, 08:59:45 AM »
There's an OnDamage hook that gives you this information.
Logged
Experiencing God's grace one day at a time.
Deathtitan77
Jr. Member
Posts: 63
Karma: 6
Re: How can I get the weapon used when you damage someone.
«
Reply #2 on:
June 18, 2013, 09:03:28 AM »
Are you talking about this?
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7801.html
Logged
Megiddo
Ulysses Team Member
Hero Member
Posts: 6214
Karma: 394
Project Lead
Re: How can I get the weapon used when you damage someone.
«
Reply #3 on:
June 18, 2013, 09:08:40 AM »
This one:
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexedfa.html
Logged
Experiencing God's grace one day at a time.
Deathtitan77
Jr. Member
Posts: 63
Karma: 6
Re: How can I get the weapon used when you damage someone.
«
Reply #4 on:
June 18, 2013, 09:10:15 AM »
Well, I have a question for you. In this example:
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexe50a.html
using dmginfo:GetInflictor():GetClass() prints 'player', any idea why?
It also says here: Entity Inflictor(usually a weapon)
«
Last Edit: June 18, 2013, 09:12:45 AM by Deathtitan77
»
Logged
Megiddo
Ulysses Team Member
Hero Member
Posts: 6214
Karma: 394
Project Lead
Re: How can I get the weapon used when you damage someone.
«
Reply #5 on:
June 18, 2013, 12:37:41 PM »
You just have to explore all the options. There is a lot of information you haven't checked into yet. The gmod documentation is wrong (or at least misleading) 49% of the time.
Logged
Experiencing God's grace one day at a time.
Print
Pages: [
1
]
Go Up
« previous
next »
Ulysses
»
General
»
Developers Corner
»
How can I get the weapon used when you damage someone.