AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TraceAttack -> Damage block -> Dead Status (https://forums.alliedmods.net/showthread.php?t=140068)

Xalus 10-08-2010 17:51

TraceAttack -> Damage block -> Dead Status
 
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

Hunter-Digital 10-08-2010 22:19

Re: TraceAttack -> Damage block -> Dead Status
 
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.

Xalus 10-09-2010 05:18

Re: TraceAttack -> Damage block -> Dead Status
 
I gonna test it now,
Thank you very much :)

Xalus 10-09-2010 06:00

Re: TraceAttack -> Damage block -> Dead Status
 
Doesn't work,
Still player 'Dead'

I also tryed to did on 100hp, but still :)

Hunter-Digital 10-10-2010 00:29

Re: TraceAttack -> Damage block -> Dead Status
 
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.


All times are GMT -4. The time now is 10:24.

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