AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Teamspecific FriendlyFire (https://forums.alliedmods.net/showthread.php?t=143760)

Schwabba 11-24-2010 13:11

Teamspecific FriendlyFire
 
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?

Exolent[jNr] 11-24-2010 15:56

Re: Teamspecific FriendlyFire
 
Instead of returning HAM_SUPERCEDE, try setting the damage to 0.
Code:
SetHamParamFloat( 4, 0.0 );

ConnorMcLeod 11-24-2010 17:17

Re: Teamspecific FriendlyFire
 
Hook TraceAttack, blood AND TakeDamage are sent from there.
TraceAttack is not called when damage is made by a nade though.

Schwabba 11-27-2010 02:54

Re: Teamspecific FriendlyFire
 
Quote:

Originally Posted by Exolent[jNr] (Post 1355920)
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 (Post 1356002)
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!

Flipper_SPb 11-27-2010 04:01

Re: Teamspecific FriendlyFire
 
PHP Code:

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


And use Ham_TakeDamage


All times are GMT -4. The time now is 11:24.

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