Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Getting objects a player threw/dropped

Here you can find ScriptAPI suggestions implemented in the game.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
MScull
Fighter
Fighter
Posts: 33
Joined: Sun May 29, 2016 9:43 pm
Title: No Title
SFD Account: MScull
SFD Alias: Scull
Started SFD: PreAlpha 1.8.8
Location: The Netherlands
Gender:
Age: 22

Getting objects a player threw/dropped

Post by MScull » Sun Feb 12, 2017 7:31 pm

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.
0 x
hi

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Mon Feb 13, 2017 12:35 am

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.
1 x

User avatar
MScull
Fighter
Fighter
Posts: 33
Joined: Sun May 29, 2016 9:43 pm
Title: No Title
SFD Account: MScull
SFD Alias: Scull
Started SFD: PreAlpha 1.8.8
Location: The Netherlands
Gender:
Age: 22

Post by MScull » Mon Feb 13, 2017 3:53 pm

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!
0 x
hi

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Thu Mar 08, 2018 8:23 pm

Moving this to the ScriptAPI suggestions.
Edit: Possible to achieve this using the ObjectCreated callback event in recent versions.
1 x
Gurt

Locked