Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: Avarax on March 04, 2007, 06:15:17 am

Title: OnPlayerDamage Parameter
Post by: Avarax 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?
Title: Re: OnPlayerDamage Parameter
Post by: EnEsCe on March 04, 2007, 06:37:08 am
a) Don't know.
b) No, it would not.
Title: Re: OnPlayerDamage Parameter
Post by: UPNPAD on May 21, 2008, 02:57:30 am
Could you add it now please :) (the Weapon parameter to OnPlayerDamage)
Title: Re: OnPlayerDamage Parameter
Post by: DorkeyDear 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...
Title: Re: OnPlayerDamage Parameter
Post by: Neosano on May 22, 2008, 04:41:52 pm
what the hell is that, Dear?
Title: Re: OnPlayerDamage Parameter
Post by: DorkeyDear 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)