AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   DMG_ALWAYSGIB friendly fire (https://forums.alliedmods.net/showthread.php?t=172711)

SyluxLockjaw100 11-24-2011 23:42

DMG_ALWAYSGIB friendly fire
 
Ok,I have a plugin that turns HE grenades to grenade launchers,and I set DMG_ALWAYSGIB for the grenade launcher,but you can team kill regardless of mp_friendlyfire - DMG_ALWAYSGIB is causing this so how can I prevent it?

Code:

public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
    if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_HEGRENADE && g_HaveGL[attacker] )
    {
        SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
        SetHamParamInteger(5, DMG_ALWAYSGIB) // this damage type is causing friendly fire even if you turn off friendly fire!
    }
}


Emp` 11-25-2011 00:13

Re: DMG_ALWAYSGIB friendly fire
 
Check if mp_friendlyfire is 1 and the victim and the attacker are on the same team and then choose one of the following:
  • Set the damage to 0
  • Don't set DMG_ALWAYSGIB


All times are GMT -4. The time now is 08:23.

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