Page 1 of 1

Getting objects a player threw/dropped

Posted: Sun Feb 12, 2017 7:31 pm
by MScull
Hello!

I was wondering if there's a way to get the object a player threw/dropped. I've scrolled through the whole API, the only thing I could find something to be maybe a little bit equivalent was the method 'IPlayer.IsThrowing'. This method doesn't return the item thrown, only a boolean.

Thanks in advance.

Re: Getting objects a player threw/dropped

Posted: Mon Feb 13, 2017 12:35 am
by JakSparro98
MScull wrote:Hello!

I was wondering if there's a way to get the object a player threw/dropped. I've scrolled through the whole API, the only thing I could find something to be maybe a little bit equivalent was the method 'IPlayer.IsThrowing'. This method doesn't return the item thrown, only a boolean.

Thanks in advance.
You should collect all the weapons and throwable that are on the ground and then store only the one which has the "Is.Missile" on true, this isn't the most reliable way because also when a grenade explodes on weapons the latter are tracked as missile, but currently is the only way to achieve it.

Re: Getting objects a player threw/dropped

Posted: Mon Feb 13, 2017 3:53 pm
by MScull
JakSparro98 wrote:
MScull wrote:Hello!

I was wondering if there's a way to get the object a player threw/dropped. I've scrolled through the whole API, the only thing I could find something to be maybe a little bit equivalent was the method 'IPlayer.IsThrowing'. This method doesn't return the item thrown, only a boolean.

Thanks in advance.
You should collect all the weapons and throwable that are on the ground and then store only the one which has the "Is.Missile" on true, this isn't the most reliable way because also when a grenade explodes on weapons the latter are tracked as missile, but currently is the only way to achieve it.
Alright, I was afraid that this was the only possible way to achieve it. Thanks for giving me an answer!

Re: Getting objects a player threw/dropped

Posted: Thu Mar 08, 2018 8:23 pm
by Gurt
Moving this to the ScriptAPI suggestions.
Edit: Possible to achieve this using the ObjectCreated callback event in recent versions.