Raised This Month: $ Target: $400
 0% 

Teamspecific FriendlyFire


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Schwabba
Senior Member
Join Date: Apr 2008
Old 11-24-2010 , 13:11   Teamspecific FriendlyFire
Reply With Quote #1

Hi, i try to disable FF for CT Team, but when i use this

PHP Code:
RegisterHam(Ham_TakeDamage "player" "PlayerHurt"0); 
PHP Code:
public PlayerHurt(id,inflictor,attacker,Float:damageDamageBits )
{
    if(
cs_get_user_team(id) == cs_get_user_team(attacker))
    {
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            return 
HAM_SUPERCEDE;
        }
        else
        {
            if(!
friendlyFire)
            {
                return 
HAM_SUPERCEDE;
            }
        }
    }
    return 
HAM_IGNORED;

Then it works, but there is still blood when you shoot someone and FF is disabled. How i can disable the blood?
Schwabba is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-24-2010 , 15:56   Re: Teamspecific FriendlyFire
Reply With Quote #2

Instead of returning HAM_SUPERCEDE, try setting the damage to 0.
Code:
SetHamParamFloat( 4, 0.0 );
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-24-2010 , 17:17   Re: Teamspecific FriendlyFire
Reply With Quote #3

Hook TraceAttack, blood AND TakeDamage are sent from there.
TraceAttack is not called when damage is made by a nade though.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 11-27-2010 , 02:54   Re: Teamspecific FriendlyFire
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
Instead of returning HAM_SUPERCEDE, try setting the damage to 0.
Code:
SetHamParamFloat( 4, 0.0 );
That was'nt working, the blood is still there and it's really like you get hitted, means maxspeed changes, you hear a sound that you got hitted etc.

Quote:
Originally Posted by ConnorMcLeod View Post
Hook TraceAttack, blood AND TakeDamage are sent from there.
TraceAttack is not called when damage is made by a nade though.
This works better, it made exactly what i want.


Thx Guys!
Schwabba is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 11-27-2010 , 04:01   Re: Teamspecific FriendlyFire
Reply With Quote #5

PHP Code:
RegisterHam(Ham_BloodColor"player""fw_BloodColorPre")
.
.
.
public 
fw_BloodColorPre(id)
{
   
SetHamReturnInteger(-1)
   return 
HAM_SUPERCEDE

And use Ham_TakeDamage
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Reply



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 11:24.


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