Shot event (Method)
Hi all, i know if was this tutorial http://forums.alliedmods.net/showthread.php?t=54887
Writed by VEN. But i see in old plugin a way to detect in other way, its counting bullets in weapon of a player. Like this: https://forums.alliedmods.net/showthread.php?t=21342 Basically this code: PHP Code:
EDIT: In my tests is not counting last bullet shot, Any suggestion? Thanks. |
Re: Shot event (Method)
What are you trying to do?
Are you using X ammount of bullets in clip to trigger event or are you just retrieving the current bullets in clip? You cant wrap your question in another question. You may be missing out on a good answer. |
Re: Shot event (Method)
Quote:
I think its the 3rd paramter, used in register_event. |
Re: Shot event (Method)
You obviously misunderstood me. So you will get the answer you asked for, not the one you may need.
"3>0" is wrong. Parameter 3 is clip ammo. Just remove it and it will count the last shot. Here you can read information about game events http://wiki.amxmodx.org/Half-Life_1_...ents#CurWeapon |
Re: Shot event (Method)
Quote:
:) |
Re: Shot event (Method)
VEN's method is ok.
You can shorten it like this : http://forums.alliedmods.net/showthr...05#post1725505 |
Re: Shot event (Method)
Quote:
:) |
Re: Shot event (Method)
But you have more code to proceed in callback.
With VEN's method, you don't need to call any native in order to filter shots. Difference is trivial, but there is still some ;) |
Re: Shot event (Method)
Quote:
If i change to "3 > 0" it not count last shot (Ex. if i fired 30 bullets its only counting 29) Its possible to resolve this small problem to use 0 ? (It That would solve the problem of aim scope from some weapons) |
Re: Shot event (Method)
Should check if m_iClip != m_iClientClip but again it would add 2 native calls.
Edit : Or change : (g_iLastAmmo[id] > iAmmo to (g_iLastAmmo[id] >= iAmmo |
| All times are GMT -4. The time now is 15:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.