Weapon Id get WeaponName
Uhhmm don't know why i cant find a solution but i have a weaponID and i want to get the weapon name...
pev_classname and pev_viewmodel are not working ... pev_weaponmodel returns a huge number... |
Re: Weapon Id get WeaponName
PHP Code:
|
Re: Weapon Id get WeaponName
Hmm thanks but thats not working either
and now i know why... I use RegisterHam(Ham_TakeDamage,"player","dmg_func ") ham_const.inc says Code:
/**I dont want to use get_user_attacker because that returns the weapon the attacker is holding currently! if i throw a he and switch to an other weapon not the he is registered as an attacker but the other weapon |
Re: Weapon Id get WeaponName
The best way is to hook CurWeapon event and remember the weapon each player has. When a player takes damage and (damagebits & DMG_BULLET && inflictor == attacker) is true that means that our user is shooted. Then you can get the weapon that he was shot.
PHP Code:
|
Re: Weapon Id get WeaponName
pev_classname or get_weaponname( cs_get_weapon_id( idinflictor ) ...... )
|
Re: Weapon Id get WeaponName
Also, when damage is made by a hegrenade, in that case inflictor is the grenade entity, attacker is the player, and damagebit is (or contains) 1<<24
|
Re: Weapon Id get WeaponName
Thanks for the help i got it working now but tell me is Ham_TakeDamage bugged ?
Why is idinflictor and idattacker the same ? |
Re: Weapon Id get WeaponName
No, it is not bugged.
Infilctor and attacker are the same when the damage is done by the player entity, (when you are shot by a weapon or knife). If you are hurt by a grenade then the attacker will be the owner of the grenade and the inflictor the grenade. |
| All times are GMT -4. The time now is 22:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.