Check and give weapons inaccuracy...
So I have this code below:
PHP Code:
|
Re: Check and give weapons inaccuracy...
I assume you use the menu very fast? If so then you should notice this behavior for all grenade types.
Take a look below. I'm using this code to check for grenades on players death accordingly so take it just as an idea. PHP Code:
|
Re: Check and give weapons inaccuracy...
That's something that I am looking for, but shouldn't player not have the grenade after grenade very recently thrown?
|
Re: Check and give weapons inaccuracy...
I think pev->weapons (check by user_has_weapon) is updated right after, so check bpammo in combination.
Also, when you are checking more than 1 weapon, prefer pev_weapons rather than user_has_weapon, but it's not a big deal if you prefer to stick with user_has_weapon, would be different if code would be called often as in PreThink for example. PHP Code:
|
Re: Check and give weapons inaccuracy...
Quote:
Not sure about pev_weapons as Connor suggested, never tested with pev_weapons :) EDIT: LOL I just realized I could check the animation, what there happens iAnimation == 1: Sequence name is "pullpin" iAnimation == 2: Sequence name is "thrown" The player has still the grenade in his hands, the grenade is not flying. user_has_weapon (for non- and active weapons) must return true like get_user_weapon (for active weapon only). According to this, pev_weapons should ... must also return true. So you will need to check for active weapon and those animations. But you can abort the pullpin if you change to another weapon, not sure if you are able to switch to another weapon if you are throwing the nade right in this moment. Maybe you want to check only for animation 2 then. Trial and error ;) |
Re: Check and give weapons inaccuracy...
pev_weapons returns the same as user_has_weapon, was just a little optimization to 3 user_has_weapon calls.
bpammo check in combination with user_has_weapon or pev_weapons should solve problem (animation is not reliable because player can have few nades from the same type, flashbang by default, other nades with specific plugins). |
Re: Check and give weapons inaccuracy...
Quote:
|
| All times are GMT -4. The time now is 10:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.