Author Topic: OnPlayerDamage Parameter  (Read 1932 times)

0 Members and 1 Guest are viewing this topic.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
OnPlayerDamage Parameter
« on: March 04, 2007, 06:15:17 am »
pretty please add "Weapons" as a string or weapon-id parameter to the OnPlayerDamage procedure EnEsCe  :-*

oh and would it be possible to make OnPlayerKill a boolean function like OnCommand and the like?
« Last Edit: March 04, 2007, 06:16:51 am by Avarax »
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: OnPlayerDamage Parameter
« Reply #1 on: March 04, 2007, 06:37:08 am »
a) Don't know.
b) No, it would not.

Offline UPNPAD

  • Major(1)
  • Posts: 36
Re: OnPlayerDamage Parameter
« Reply #2 on: May 21, 2008, 02:57:30 am »
Could you add it now please :) (the Weapon parameter to OnPlayerDamage)

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: OnPlayerDamage Parameter
« Reply #3 on: May 21, 2008, 05:20:28 am »
oh and would it be possible to make OnPlayerKill a boolean function like OnCommand and the like?
Code: [Select]
function OnPlayerKillB(Killer, Victim: byte): boolean;
begin
//...
//Result = true when wanting to have player live
end;

function OnPlayerDamage(Shooter, Victim: byte; Damage: integer): integer;
begin
  Result := Damage;
  if (GetPlayerStat(Victim, 'Health') <= Damage) then begin
    if (OnPlayerKillB(Shooter, Victim)) then begin
      Result := GetPlayerStat(Victim, 'Health') - 1;
    end;
  end;
end;

something similar to that... except i dont think damage and health always align some reason..

completely ignoring vest...

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: OnPlayerDamage Parameter
« Reply #4 on: May 22, 2008, 04:41:52 pm »
what the hell is that, Dear?
KAWAAAAAAAIIIIIIIIII

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: OnPlayerDamage Parameter
« Reply #5 on: May 22, 2008, 05:02:08 pm »
what the hell is that, Dear?
OnPlayerDamage, whenever anybody gets hurt, it checks if they received enough damage to die... if so, then it calls OnPlayerKillB, and if it returns true, then OnPlayerDamage will return enough damage to have the person remain at 1 health, otherwise the player will die...
Can be modified to set health when they should have died... (atm it wouldn't work properly)