Raised This Month: $ Target: $400
 0% 

Solved stop losing hp of victim?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:53.


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