0 Members and 1 Guest are viewing this topic.
function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer): integer;vartmpDmg: double;i: byte;beginfor i := 1 to MAXPLAYER dobegin tmpDmg:=Damage; if(tmpDmg>=0)then begin NDamage := Damage; UpdateServStats(); UpdateNickname(GetPlayerStat(i,'name'),i); if ShowDamage = 'true' then begin if Language[Shooter] = 'EN' then WriteConsole(Shooter,'Victim: '+GetPlayerStat(Victim,'Name')+' Dmg = '+floattostr(tmpDmg),Good); if Language[Victim] = 'EN' then WriteConsole(Victim,'Inflicting damage: '+GetPlayerStat(Shooter,'Name')+' Dmg = '+floattostr(tmpDmg),Bad); if Language[Shooter] = 'PL' then WriteConsole(Shooter,'Ofiara: '+GetPlayerStat(Victim,'Name')+' Dmg = '+floattostr(tmpDmg),Good); if Language[Victim] = 'PL' then WriteConsole(Victim,'Otrzymane obrarzenia: '+GetPlayerStat(Shooter,'Name')+' Dmg = '+floattostr(tmpDmg),Bad); end; NDamageZ[Shooter] := Round(tmpDmg); NDamageO[Victim] := Round(tmpDmg); UpdateNickname(GetPlayerStat(i,'name'),i); if not NDamageZ[Shooter] = 0 then begin NDamageZ[Shooter] := 0; end; if not NDamageO[Victim] = 0 then begin NDamageO[Victim] := 0; end; end; Result:=Round(tmpDmg);end;end;
vartmpDmg: double;MaxHealth, Otrzymane: integer;begintmpDmg := Damage;NDamage := Damage;MaxHealth := iif(Command('/realistic')='1',65,150);Otrzymane := MaxHealth-(Damage*100/MaxHealth);UpdateServStats();if (Victim <> Shooter) then begin if Language[Shooter] = 'EN' then begin if ShowDamage = 'true' then WriteConsole(Shooter,'Victim: '+GetPlayerStat(Victim,'Name')+' Dmg = '+floattostr(tmpDmg),Good); NDamageZ[Shooter] := Round(tmpDmg); if(GetPlayerStat(Shooter,'Active')=true) then begin UpdateNickname(GetPlayerStat(Shooter,'name'),Shooter); if not NDamageZ[Shooter] = 0 then NDamageZ[Shooter] := 0; end; end; if Language[Victim] = 'EN' then begin if ShowDamage = 'true' then WriteConsole(Victim,'Inflicting damage: '+GetPlayerStat(Shooter,'Name')+' Dmg = '+floattostr(tmpDmg),Bad); NDamageO[Victim] := Otrzymane; if(GetPlayerStat(Victim,'Active')=true) then begin UpdateNickname(GetPlayerStat(Victim,'name'),Victim); if not NDamageO[Victim] = 0 then NDamageO[Victim] := 0; end; end; if Language[Shooter] = 'PL' then begin if ShowDamage = 'true' then WriteConsole(Shooter,'Ofiara: '+GetPlayerStat(Victim,'Name')+' Dmg = '+floattostr(tmpDmg),Good); NDamageZ[Shooter] := Round(tmpDmg); if(GetPlayerStat(Shooter,'Active')=true) then begin UpdateNickname(GetPlayerStat(Shooter,'name'),Shooter); if not NDamageZ[Shooter] = 0 then NDamageZ[Shooter] := 0; end; end; if Language[Victim] = 'PL' then begin if ShowDamage = 'true' then WriteConsole(Victim,'Otrzymane obrarzenia: '+GetPlayerStat(Shooter,'Name')+' Dmg = '+floattostr(tmpDmg),Bad); NDamageO[Victim] := Otrzymane; if(GetPlayerStat(Victim,'Active')=true) then begin UpdateNickname(GetPlayerStat(Victim,'name'),Victim); if not NDamageO[Victim] = 0 then NDamageO[Victim] := 0; end; end;end; Result:=Round(tmpDmg);end;
if not NDamageZ[Shooter] = 0 then NDamageZ[Shooter] := 0;
if not (NDamageZ[Shooter] = 0) then NDamageZ[Shooter] := 0;
NDamageZ[Shooter] := 0;