Firstblood

From Soldat Community Wiki
Revision as of 17:47, 14 August 2012 by Freeman (talk | contribs) (Created page with "===Script by Spkka=== <source lang="pascal">var firstBlood: integer; GOOD, BAD: longint; procedure ActivateServer(); begin //color of writeconsole messages GOOD := $EE00F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Script by Spkka

var
	firstBlood: integer;
	GOOD, BAD: longint;

procedure ActivateServer();
begin
	//color of writeconsole messages
	GOOD := $EE00FF00;
	BAD := $FFFF4444;
	//reset firstblood
	firstBlood := 1;
end;

procedure OnMapChange(NewMap: string);
begin
	//reset firstblood
	firstBlood := 1;
end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
	//check for firstblood and award 10 points
	if (firstBlood > 0) and (Killer <> Victim) then 
	begin
		firstBlood := 0;
		WriteConsole(0, 'FIRST BLOOD: '+IDToName(Killer) + ' killed '+IDToName(Victim),GOOD);
		WriteConsole(0, '10 Points Awarded!',GOOD);
		SetScore(Killer,GetPlayerStat(1, 'Kills' ) + 10 );
	end

	//if killer suicide then there is no firstblood
	if (firstblood > 0) and (Killer = Victim) then 
	begin
		firstBlood := 1;
	end
end;