I have two problem with forward ze_user_infected_pre

Coding Help/Re-API Supported
Post Reply
User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 477
Joined: 5 years ago
Location: The Red City ❤
Contact:

I have two problem with forward ze_user_infected_pre

#1

Post by z0h1r-LK » 3 years ago

Hi
I was want create plugin is make zombie is kill is not infect
Problem 1: When i use return 1 is became knock-back is stopped !
Problem 2: When health of the human became 0 is infect is not dead !
  1. // forward pre-infection
  2. public ze_user_infected_pre(iVictim, iInfector, iDamage)
  3. {
  4.     // Check from infector is valid
  5.     if (iInfector != 0 && g_bIsSwarm)
  6.     {
  7.         // Check from damage is started
  8.         if (g_bStartDamage)
  9.         {
  10.             // Get current health victim
  11.             new iHealth = floatround(get_entvar(iVictim, var_health))
  12.  
  13.             if (iHealth > 0)
  14.             {
  15.                 // Get new damage
  16.                 new iNewDamage = iDamage * get_pcvar_num(g_pCvarDamage)
  17.  
  18.                 // Check from health victim is not equal zero
  19.                 if ((iHealth - iNewDamage) > 0)
  20.                 {
  21.                     // Damage victim  
  22.                     set_entvar(iVictim, var_health, float(iHealth - iNewDamage))
  23.                 }
  24.                 else // Kill victim
  25.                 {
  26.                     // ExecuteHam(Ham_Killed, iVictim, iInfector)   // I don't know it's not working !
  27.  
  28.                     user_kill(iVictim)
  29.  
  30.                     // Death message
  31.                     SendDeathMsg(iInfector, iVictim)
  32.  
  33.                     // Update frags
  34.                     UpdateFrags(iInfector, iVictim, get_pcvar_num(g_pCvarFrag), get_pcvar_num(g_pCvarDeath), 1)
  35.                 }
  36.  
  37.                 return 1
  38.             }
  39.         }
  40.     }
  41.  
  42.     return 0
  43. }

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 3 years ago

Hi
Knockback on humans?

Please explain what you are trying to do.
He who fails to plan is planning to fail

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 477
Joined: 5 years ago
Location: The Red City ❤
Contact:

#3

Post by z0h1r-LK » 3 years ago

Raheem wrote: 3 years ago Hi
Knockback on humans?

Please explain what you are trying to do.
Zombies
I wanna make zombie is damage player ...
when i use this code knockback became not working when zombies

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 11 guests