Treat Famas as shield
Hi everyone :),
How can I make CS Engine treat the Famas as Shield ? I tried : const SHIELD_DRAW = (1<<16) const WEAPONSTATE_SHIELD_DRAW = (1<<5) new iEnt = get_pdata_cbase(id, m_pActiveItem, 5) set_pdata_bool(id, m_bHasShield, true, 5) set_pdata_bool(id, m_boolsUserPrefsAndShield, SHIELD_DRAW, 5) set_pdata_bool(id, m_bUsesShield, true, 5) set_pdata_int(iEnt, m_fWeaponState, WEAPONSTATE_SHIELD_DRAW, 4) I do this code to a player, when he die, he drop a shield, but he still take damage from guns How can I do to treat famas as shield ? |
Re: Treat Famas as shield
Hook TakeDamage and check if the attacker is in view cone of the player with Famas. If he is, block the damage and play the different sound.
This is most likely not how it's done in the original engine. Check CSSDK if you want to see how CS handles the shield. |
Re: Treat Famas as shield
I already checked CS-SDK before ask this question , In CS-SDK , there is a stock IsProtectedByShield() , it return 1 when m_fUserPref is (1<<16) and user has shield. I already did that but player still take damage
|
| All times are GMT -4. The time now is 21:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.