0 Members and 1 Guest are viewing this topic.
//Friendly Fire with Accidental Forgiveness//Created by: Curt//http://forums.soldat.pl/index.php?topic=14394const KillonTK = true; //If the shooter kills a friendly, then he will or will not be killed (it is possible for him to TK and not die, although it can still be on accident if a friendly is low on health and shoots them in spray or something); Ignore this if RecTimes is 0 DmgNeed = 50; //Total damage needed for friendly fire to start hurting the shooter FFTimes = 1.5; //Number of times more or less damage the shooter receives damage when shooting a friendly RecTimes = 0; //Number of times more or less damage the victim of a friendly fire receives; set to 0 if you want the victim to not be harmed DmgTimes = 3; //Number of times damage needed a friendly firer needs to do to an enemy to make his friendly fire damage counter to lower back downvar TKBuild: array[1..32] of integer;procedure OnJoinGame(ID, Team: byte);begin if TKBuild[ID] <> 0 then TKBuild[ID] := 0;end;procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin if (KillonTK) and (Killer <> Victim) and (GetPlayerStat(Killer,'Team') = GetPlayerStat(Victim,'Team')) then DoDamage(Killer,4000);end;function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;begin Result := Damage; if (Shooter <> Victim) and (GetPlayerStat(Victim,'Alive') = true) then if GetPlayerStat(Shooter,'Team') = GetPlayerStat(Victim,'Team') then begin Result := Round(Damage * RecTimes); TKBuild[Shooter] := TKBuild[Shooter] + Damage; if TKBuild[Shooter] >= DmgNeed then DoDamage(Shooter,Round(Damage * FFTimes)); end else begin if TKBuild[Shooter] > 0 then TKBuild[Shooter] := TKBuild[Shooter] - Round(Damage / DmgTimes); if TKBuild[Shooter] < 0 then TKBuild[Shooter] := 0; end;end;
You should put something in the OnJoin event to reset TKBuild[ID_of_joiner] to the default value.If you don't do that, I can make a lot of TKs and quit the server, whoever joins and is assigned with the ID I was using will already start with a high TKBuild.
My new password is secure as shit Mate, I am not sure Shit is even secured nowadays.
Your post still says that the script is set up for Server Core 2.6.0.