cs_get_weapon_ammo returning "Non-player entity"
Hello,
Today I tried out to retrieve player's weapon ammo inside FM_PlaybackEvent but every time I ran into this error: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: cs_get_weapon_ammo returning "Non-player entity"
Code:
|
Re: cs_get_weapon_ammo returning "Non-player entity"
No, it shouldn't. Pass the weapon ENTITY index. CHECK_NONPLAYER checks to make sure the entity you passed is not a player. The error message is correct, you passed id = 1 whicb is a player id and the native does not want that.
Based on "eventid" you know for which weapon the forward was triggered(you can deduce the CSW_* index). With the csw index you can retrieve the weapon entity index. Also, what is "iPlayer"? In the forward header you have "id". |
Re: cs_get_weapon_ammo returning "Non-player entity"
Thank you!
I will try what Hamlet said. And about this Quote:
Solved passing the Weapon Entity index retrieved from player's pdata: PHP Code:
|
Re: cs_get_weapon_ammo returning "Non-player entity"
I wasn't paying careful enough attention. Thought you needed stronger filter. That just made matters worse! Added more relevant code. A stock I use to get ammo from player's index.
|
| All times are GMT -4. The time now is 02:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.