AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Zombie & Human Friendly Fire. (https://forums.alliedmods.net/showthread.php?t=99645)

Mr.Noobie 08-08-2009 00:45

Zombie & Human Friendly Fire.
 
Is it possible to make friendly fire in zombie plague ?? cos i saw some server which had it.

the command "mp_friendlyfire 1" was block in zombie plague.

I search some codes in the source file.

PHP Code:

// Prevent friendly fire
 
if (g_zombie[attacker] == g_zombie[victim])
  return 
HAM_SUPERCEDE

I try to delete it. it work but, didn't work very well.

I wanted to make zombie can hit other zombie without infecting them. but when i delete the codes it infect them instead of hitting.

I can't seem to make friendly fire on humans. Can someone help me ??

I want to make friendly fire on both human, zombies.

SnoW 08-08-2009 07:01

Re: Zombie & Human Friendly Fire.
 
I made this fast up, but it's worth testing, just replace:
PHP Code:

// Prevent friendly fire
if (g_zombie[attacker] == g_zombie[victim])
     return 
HAM_SUPERCEDE

With:
PHP Code:

// Friendly fire
 
if( !g_zombieattacker ] )
{
     if( !
g_zombievictim ] )
     {
          if ( !
g_nemesis[victim])
          {
               
damage *= get_pcvar_floatcvar_zombiearmor );
               
SetHamParamFloat4damage );
          }
          return 
HAM_IGNORED;
     }
}
else if( 
g_zombievictim ] )
{
     if ( 
damage_type DMG_HEGRENADE )
          return 
HAM_SUPERCEDE;
     if ( 
g_nemesisattacker ] && inflictor == attacker )
          
SetHamParamFloat(4get_pcvar_floatcvar_nemdamage ) );
     return 
HAM_IGNORED;



Mr.Noobie 08-08-2009 07:32

Re: Zombie & Human Friendly Fire.
 
Quote:

Originally Posted by SnoW (Post 893291)
I made this fast up, but it's worth testing, just replace:
PHP Code:

// Prevent friendly fire
if (g_zombie[attacker] == g_zombie[victim])
     return 
HAM_SUPERCEDE

With:
PHP Code:

// Friendly fire
 
if( !g_zombieattacker ] )
{
     if( !
g_zombievictim ] )
     {
          if ( !
g_nemesis[victim])
          {
               
damage *= get_pcvar_floatcvar_zombiearmor );
               
SetHamParamFloat4damage );
          }
          return 
HAM_IGNORED;
     }
}
else if( 
g_zombievictim ] )
{
     if ( 
damage_type DMG_HEGRENADE )
          return 
HAM_SUPERCEDE;
     if ( 
g_nemesisattacker ] && inflictor == attacker )
          
SetHamParamFloat(4get_pcvar_floatcvar_nemdamage ) );
     return 
HAM_IGNORED;




undefined symbol "inflictor"

SnoW 08-08-2009 08:06

Re: Zombie & Human Friendly Fire.
 
Weird, with my plugin it compiles fine. What version are you using?
Go to line 2306, which is following:
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type

If you've the 2nd parameter something else than "inflictor", replace the word in the code I gave you to that.

Mr.Noobie 08-08-2009 08:42

Re: Zombie & Human Friendly Fire.
 
Quote:

Originally Posted by SnoW (Post 893325)
Weird, with my plugin it compiles fine. What version are you using?
Go to line 2306, which is following:
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type

If you've the 2nd parameter something else than "inflictor", replace the word in the code I gave you to that.

Sorry my mistake, because i change this part also.

PHP Code:

public fw_TraceAttack(victimattackerFloat:damageFloat:direction[3], tracehandledamage_type)


Still can't friendly fire. even i try to change this mp_friendlyfire 0 to mp_friendlyfire 1

Mr.Noobie 08-12-2009 03:36

Re: Zombie & Human Friendly Fire.
 
Please help. :(


All times are GMT -4. The time now is 18:20.

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