0 Members and 1 Guest are viewing this topic.
varFirstBlood: string;procedure OnMapChange(NewMap: string);beginFirstBlood := '0';end;procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);beginif (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;
SetScore(Killer,GetPlayerStat(1,'KILLS')+5);
varFirstBlood: boolean;procedure ActivateServer();begin firstblood := true;end;procedure OnMapChange(NewMap: string);beginFirstBlood := true;end;procedure OnPlayerKill(Killer, Victim, Weapon: string);beginif 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;
varFirstBlood: boolean;procedure ActivateServer();begin firstblood := true;end;procedure OnMapChange(NewMap: string);beginFirstBlood := true;end;procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);beginif FirstBlood then begin if (Killer <> Victim) then begin FirstBlood := false; 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),0.8,20,370); end;end;
unit FirstBlood;interfaceimplementationconst AddPoints = 5; //Extra points as fistkill ColorConsoleText = $DD98FF10; //Console text color ColorBigText = $FF3300; //Big text color BigTextPosX = 284; //Positon X BigTextPosY = 367; //Positon Y BigTextScale = 0.155; //Text size BitTextDisplayTime = 330; //Time in ms BigTextLayer = 77; //If bigtext conflict with other texts on the screen change it//-------------------------------------------------------------------var FirstBlood: boolean;procedure ChangeAfter(Next: string);begin FirstBlood := true;end;procedure OnKill(Killer, Victim: TActivePlayer; BulletId: Byte);begin if FirstBlood then begin if (Killer.ID <> Victim.ID) then begin FirstBlood := false; Killer.Kills := Killer.Kills+AddPoints; Players.WriteConsole('FIRSTBLOOD! '+Victim.Name+' killed by '+Killer.Name,ColorConsoleText); Players.WriteConsole(Killer.Name+' gained +'+inttostr(AddPoints)+' extra point !!',ColorConsoleText); Players.BigText(BigTextLayer,'FIRST BLOOD !',BitTextDisplayTime,ColorBigText,BigTextScale,BigTextPosX,BigTextPosY); end; end;end;procedure ScriptDecl();var i:byte;begin for i := 1 to 32 do Players[i].OnKill := @OnKill; Map.OnAfterMapChange := @ChangeAfter; firstblood := true;end; initializationbegin ScriptDecl();end;finalization;end.