Thread: [Solved] stop losing hp of victim?
View Single Post
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 07-24-2017 , 14:54   stop losing hp of victim?
Reply With Quote #1

Hi
my idea . i want make anti-infection if human has armor dos not infected
i try to set human his hp when tok dmg from zombie :
PHP Code:
public plugin_init(){
   
   
RegisterHam(Ham_TraceAttack,"player","fw_TraceAttack")
}

public 
fw_TraceAttack(victiminflictorFloat:damageFloat:direction[3], traceresultdamagebits){
   
   if(
damagebits == DMG_CLUB){ // crowbar dmg
      
      
      
if(floatround(damage) && get_user_armor(victim))
      {
         
         
set_user_armor(victimget_user_armor(victim) - 35// here i want victim losing 50 armor old dmg = 15 + 35 = 50 :P
         
set_user_health(victimget_user_health(victim) + 5// give the victim hp is losing (5) when has armor 
         
      
}/*else if(floatround(damage) > get_user_armor(victim) ) {
         
         //set_user_armor(victim, 0)
         //set_user_health(victim, 100)
         //return //HAM_IGNORED
      }*/
      
      //if(!is_user_alive(victim) || get_user_armor(victim)) return HAM_IGNORED
   
}

But I think it's a bad way and it does not work well in all cases
Is it correct or better pleas ?
__________________

Last edited by abdobiskra; 09-18-2017 at 06:56.
abdobiskra is offline
Send a message via Skype™ to abdobiskra