Raised This Month: $ Target: $400
 0% 

Treat Famas as shield


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
darktemplar
Member
Join Date: Sep 2009
Old 03-13-2013 , 12:40   Treat Famas as shield
Reply With Quote #1

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 ?
darktemplar is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 03-13-2013 , 13:19   Re: Treat Famas as shield
Reply With Quote #2

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.

Last edited by Backstabnoob; 03-13-2013 at 13:20.
Backstabnoob is offline
darktemplar
Member
Join Date: Sep 2009
Old 03-13-2013 , 22:08   Re: Treat Famas as shield
Reply With Quote #3

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
darktemplar is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode