Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage Pre issues


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 01-12-2014 , 13:31   Ham_TakeDamage Pre issues
Reply With Quote #1

I got a lil problem with this when i try to ignore the damage dealt to the victim, using SetHamParamFloat(4, 0.0) doesnt work, all normal damage is still being performed so then i tried to change the attackerid to the victimid so that zombie plague could not process this whole event as a possible infection. but this doesnt work neither.
Is it possible to change the damagebits to DMG_FALL and change the attackerid to the victimid? unless some1 can see why the damage would still be the normal damage, i dont see any other options.

Also the hamhook is not being executed on bots

PHP Code:
public plugin_init()
{
 
RegisterHam(Ham_TakeDamage"player""player_hurt_pre")
}
public 
player_hurt_pre(victiminflictorattackerFloat:damage)
{
 if( 
attacker <= || !pev_valid(attacker) || victim == attacker || !is_user_connected(attacker))
 {
  return 
HAM_IGNORED
 
}
 
 
//client_print(attacker, print_chat, "playerhurt_pre called, vic: %i & att: %i, vic zombie: %i, vic survivor: %i", victim, attacker, zp_get_user_zombie(victim), zp_get_user_survivor(victim))
 
new uspid get_weaponid("weapon_usp")
 new 
attweaponid get_user_weapon(attacker)
 
client_print(attackerprint_chat"good here 9, you need: %i, you have: %i"uspidattweaponid)
  
 if((
attweaponid == CSW_USP) && zp_get_user_zombie(attacker) )
 {
  
SetHamParamFloat(40.0)
  if ( !
zp_get_user_zombie(victim) && !zp_get_user_survivor(victim))
  {
   new 
cl_name[46]
   
get_user_name(victimcl_namesizeof(cl_name))
    
   
client_print(attackerprint_chat"good here 9.2, bool: %i, your zombie class: %i, you need: %i"g_bHas_T_pistol[attacker], zp_get_user_zombie_class(attacker), g_zclass_cell)
   
   if( 
g_bHas_T_pistol[attacker] && zp_get_user_zombie_class(attacker) == g_zclass_cell) )
   {
    
client_print(attackerprint_chat"good here 10")
    if( 
g_bHasImmunity[victim] )
    {
     
client_print(victimprint_chat"[ZP] Your Immunity against sleeper cell mutagens has succesfully warded off a mutagen attack.")
     
client_print(attackerprint_chat"[ZP] %s has immunity against your sleeper cell mutagens"cl_name)
     return 
HAM_SUPERCEDE
    
}
    
    if( !
task_exists(victim TASK_CHECKHITS) )
    {
     
set_task(3.0"Check_vichits",victim TASK_CHECKHITS)
    }
    
g_Thits[victim]++
    
g_Thitsattacker[victim] = attacker
        
    client_print
(attackerprint_chat"[ZP] Your T-Virus cell has hit %s, total hits on this player: %i"cl_nameg_Thits[victim])
   
   }
  }
  
SetHamParamInteger(3victim)
  return 
HAM_SUPERCEDE
 
}
 
 return 
HAM_HANDLED

__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 01-13-2014 at 18:26.
striker07 is offline
 



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 10:10.


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