Server Talk > Scripting Releases

FirstBlood Script

(1/3) > >>

xmRipper:
Script Name: FirstBlood Script
Script Description: Gives +5 extra points to the person who kills first in map.
Original Author(s): xmRipper
Core Version: 2.6.0


--- Code: ---var
FirstBlood: string;

procedure OnMapChange(NewMap: string);
begin
FirstBlood := '0';
end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if (FirstBlood = '0') then begin
if (Killer <> Victim) then begin
FirstBlood := '1';
WriteConsole(0,'FIRSTBLOOD! '+IDToName(Victim)+' killed by '+IDToName(Killer),RGB(0,255,255));
WriteConsole(0,IDToName(Killer)+' gained +5 extra point !!',RGB(0,255,255));
SetScore(Killer,GetPlayerStat(Killer,'KILLS')+5);
DrawText(0,'FIRST BLOOD !',330,RGB(255,0,0),1.10,20,370);
end;
end;
end;

--- End code ---

iftach:

--- Code: ---SetScore(Killer,GetPlayerStat(1,'KILLS')+5);
--- End code ---
change the 1 to Killer.

xmRipper:
Sorry :)
Fixed.

DorkeyDear:
Could really make people smile! Good job.

ManSoft|Warlord:
Fixed 2.6.1 version:

http://web0.res0.45188.vs.webtropia.com/soldatnet/?cat=7


--- Code: ---var
FirstBlood: boolean;

procedure ActivateServer();
begin
  firstblood := true;
end;

procedure OnMapChange(NewMap: string);
begin
FirstBlood := true;
end;

procedure OnPlayerKill(Killer, Victim, Weapon: string);
begin
if FirstBlood then begin
  if (Killer <> Victim) then begin
    FirstBlood := false;
    WriteConsole(0,'FIRSTBLOOD! '+IdToName(StrToInt(Victim))+' killed by '+IdToName(StrToInt(Killer)),RGB(0,255,255));
    WriteConsole(0,IdToName(StrToInt(Killer))+' gained +5 extra point !!',RGB(0,255,255));
    SetScore(StrToInt(Killer),GetPlayerStat(StrToInt(Killer),'Kills')+5);
    DrawText(0,'FIRST BLOOD !',330,RGB(255,0,0),0.8,20,370);
  end;
end;
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version