Event when user gets a new weapon
How can I detect when a user bought a new weapon or picked it up from the ground?
Basically I want to get what weapons the user is carrying in real time and get notified when they change, preferably with some event handler. (Game is Counter-Strike) |
Re: Event when user gets a new weapon
You can try Ham_AddPlayerItem. This thread has some examples: https://forums.alliedmods.net/showthread.php?t=85632
To get all of his weapons, you can use pev( id , pev_weapons ), which will give you all of their weapons in a bitfield of the CSW_ weapon ID's. |
Re: Event when user gets a new weapon
Quote:
WARNING [356]: expression has no effect WARNING [356]: expression has no effect ERROR [356]: undefined symbol "pev" ERROR [356]: expected token: ";", but found ")" ERROR [356]: invalid expression, assumed zero |
Re: Event when user gets a new weapon
Add fakemeta
new iWeaponBits = pev( id , pev_weapons ); |
Re: Event when user gets a new weapon
Another way you can try is the WeapPickup event
|
Re: Event when user gets a new weapon
I added fakemeta and all worked perfectly after. Thanks.
|
All times are GMT -4. The time now is 21:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.