Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started 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?
-
a) Don't know.
b) No, it would not.
-
Could you add it now please :) (the Weapon parameter to OnPlayerDamage)
-
oh and would it be possible to make OnPlayerKill a boolean function like OnCommand and the like?
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...
-
what the hell is that, Dear?
-
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)