Raised This Month: $ Target: $400
 0% 

TraceAttack -> Damage block -> Dead Status


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-08-2010 , 17:51   TraceAttack -> Damage block -> Dead Status
Reply With Quote #1

Hello,
I'm working on a mod..

And I wanna freeze the player, when they are 'dead'

I did like:
Code:
if( (get_user_health(iVictim) - flDamage) <= 0 && is_user_connected(iAttacker)) {
                return HAM_SUPERCEDE
but if I do like that,
Ingame it says hes Dead
-> I can't set glow on him

How to fix?
That it doesn't say Dead
__________________
Retired.
Xalus is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-08-2010 , 22:19   Re: TraceAttack -> Damage block -> Dead Status
Reply With Quote #2

If you want to make a player freeze instead of dying, you could just do this:
Code:
//...

RegisterHam(Ham_TakeDamage, "player", "player_damage")

//...

public player_damage(id, iWeapon, attacker, Float:fDamage, iType)
{
   static iHP

   iHP = get_user_health(id)

   if((iHP - fDamage) <= 0)
   {
       SetHamParamFloat(4, iHP - 1.0) // alter damage so it leaves player with 1hp

       /* your freezing/glowing stuff */

       return HAM_HANDLED
   }

   return HAM_IGNORED
}
And after that you can do whatever you want with the player, kill him, unfreeze him, w/e.

If that's not what you need, then explain what exacly you want to do.
__________________

Last edited by Hunter-Digital; 10-08-2010 at 22:23.
Hunter-Digital is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 05:18   Re: TraceAttack -> Damage block -> Dead Status
Reply With Quote #3

I gonna test it now,
Thank you very much
__________________
Retired.
Xalus is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 06:00   Re: TraceAttack -> Damage block -> Dead Status
Reply With Quote #4

Doesn't work,
Still player 'Dead'

I also tryed to did on 100hp, but still
__________________
Retired.
Xalus is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-10-2010 , 00:29   Re: TraceAttack -> Damage block -> Dead Status
Reply With Quote #5

Try HAM_OVERRIDE instead of HAM_HANDLED then.

But the code should work, it can't print DEAD if the player is still alive... there's something wrong in your plugin or other plugins.
__________________
Hunter-Digital is offline
Reply



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


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