Ulysses

General => Developers Corner => Topic started by: Deathtitan77 on June 18, 2013, 08:55:15 AM

Title: How can I get the weapon used when you damage someone.
Post by: Deathtitan77 on June 18, 2013, 08:55:15 AM
How can I do that?
Title: Re: How can I get the weapon used when you damage someone.
Post by: Megiddo on June 18, 2013, 08:59:45 AM
There's an OnDamage hook that gives you this information.
Title: Re: How can I get the weapon used when you damage someone.
Post by: Deathtitan77 on June 18, 2013, 09:03:28 AM
Are you talking about this? http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7801.html
Title: Re: How can I get the weapon used when you damage someone.
Post by: Megiddo on June 18, 2013, 09:08:40 AM
This one: http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexedfa.html
Title: Re: How can I get the weapon used when you damage someone.
Post by: Deathtitan77 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)
Title: Re: How can I get the weapon used when you damage someone.
Post by: Megiddo 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.