Author Topic: Kills log (work in progress, help appreciated)  (Read 943 times)

0 Members and 1 Guest are viewing this topic.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Kills log (work in progress, help appreciated)
« on: October 17, 2007, 01:01:49 pm »
Code: [Select]
const
  PunishSuic=false;
var
  FKillsA, FKillsB, FSuicA, FSuicB: integer;
  KillsA, SuicA: array[1..AlphaPlayers] of integer;
  KillsB, SuicB: array[1..BravoPlayers] of integer;
  DSpotXA, DSpotYA: array[1..FKillsA] of single;
  DSpotXB, DSpotYB: array[1..FKillsB] of single;
  DNameA: array[1..FKillsA] of string;
  DNameB: array[1..FKillsB] of string;
  SNameA: array[1..FSuicA] of string;
  SNameB: array[1..FSuicB] of string;
procedure OnPlayerKill(Killer, Victim: Byte);
begin
  if Killer <> Victim then begin
//-----OnKill-----
//---Alpha---
    if GetPlayerStat(Killer,'Team') = 1 then begin
      KillsA[Killer]:=KillsA[Killer]+1;
      DSpotXB[FKillsA]:=Roundto(1,GetPlayerStat(Victim,'x'));
      DSpotYB[FKillsA]:=Roundto(1,GetPlayerStat(Victim,'y'));
      DNameB[FKillsA]:=GetPlayerStat(Victim,'name');
      FKillsA:=FKillsA+1;
    end;
//---Bravo---
    if GetPlayerStat(Killer,'Team') = 2 then begin
      KillsB[Killer]:=KillsB[Killer]+1;
      DSpotXA[FKillsB]:=Roundto(1,GetPlayerStat(Victim,'x'));
      DSpotYA[FKillsB]:=Roundto(1,GetPlayerStat(Victim,'y'));
      DNameA[FKillsB]:=GetPlayerStat(Victim,'name');
      FKillsB:=FKillsB+1;
    end;
  end else begin
//-----OnSuicide-----
//---Alpha---
    if GetPlayerStat(Killer,'Team') = 1 then begin
      SuicA[Killer]:=SuicA[Killer]+1;
      SNameA[FSuicA]:=GetPlayerStat(Victim,'name');
      FSuicA:=FSuicA+1;
      if PunishSuic = true then FKillsA:=FKillsA-1;
    end;
//---Bravo---
    if GetPlayerStat(Killer,'Team') = 2 then begin
      SuicB[Killer]:=SuicB[Killer]+1;
      SNameB[FSuicB]:=GetPlayerStat(Victim,'name');
      FSuicB:=FSuicB+1;
      if PunishSuic = true then FKillsB:=FKillsB-1;
    end;
  end;
end;

function OnPlayerCommand(ID:Byte;Text:string):boolean;
var
  Temp: array[1..3] of string;
  i: integer;
  Returnstr: string;
begin
  Result:=false;
  Temp[1]:=GetPiece(LowerCase(Text), ' ', 0);
  if Temp[1] = '/kills' then begin
    Temp[2]:=GetPiece(LowerCase(Text), ' ', 1);
    if Temp[2] = 'a' or Temp[2] = 'alpha' then begin
      Temp[3]:=GetPiece(LowerCase(Text), ' ', 2);
      if Temp[3] = 'all' then for i:=1 to FKillsA do begin
        SayToPlayer(ID,KillsA[i]);
      end;
    end;
  end;
end;

again, a work in progress, will try to fin when I get home...

can anyone make the command parts?
« Last Edit: October 17, 2007, 10:41:42 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Kills log (work in progress, help appreciated)
« Reply #1 on: October 17, 2007, 09:15:07 pm »
Oh god, please, do not use Variants in such a manner. You are brutally beating up Pascal

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Kills log (work in progress, help appreciated)
« Reply #2 on: October 17, 2007, 10:41:02 pm »
I am? sorry :(

I think I might leave this how it is and see if anyone picks it up later, because I'm not sure how to code the rest (the commands to show a list of kills, suicides, Death points, etc.)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Kills log (work in progress, help appreciated)
« Reply #3 on: October 26, 2007, 08:53:03 am »
SNameB: array[1..FSuicB] of string;

You sure this would work with the value of FSuicB not yet defined? I'm sure it won't.
-=Gradius wuz you=-