0 Members and 1 Guest are viewing this topic.
const//TeamsALPHA = 1;BRAVO = 2;CHARLIE = 3;DELTA = 4;SPECTATOR = 5;//Game ModesDEATHMATCH = 0;POINTMATCH = 1;TEAMMATCH = 2;CTF = 3;RAMBO = 4;INF = 5;HTF = 6;SERVER = 255;varkills: array[1..32] of integer;varkillLog: array[1..32] of byte;voteTime: array[1..32] of byte;spawnKill: array[1..32] of byte;killAtSpawn: byte;function IDtoTeam(PlayerID: integer):integer;begin case PlayerID of 1: Result:= Player_Team_1; 2: Result:= Player_Team_2; 3: Result:= Player_Team_3; 4: Result:= Player_Team_4; 5: Result:= Player_Team_5; 6: Result:= Player_Team_6; 7: Result:= Player_Team_7; 8: Result:= Player_Team_8; 9: Result:= Player_Team_9; 10: Result:= Player_Team_10; 11: Result:= Player_Team_11; 12: Result:= Player_Team_12; 13: Result:= Player_Team_13; 14: Result:= Player_Team_14; 15: Result:= Player_Team_15; 16: Result:= Player_Team_16; 17: Result:= Player_Team_17; 18: Result:= Player_Team_18; 19: Result:= Player_Team_19; 20: Result:= Player_Team_20; 21: Result:= Player_Team_21; 22: Result:= Player_Team_22; 23: Result:= Player_Team_23; 24: Result:= Player_Team_24; 25: Result:= Player_Team_25; 26: Result:= Player_Team_26; 27: Result:= Player_Team_27; 28: Result:= Player_Team_28; 29: Result:= Player_Team_29; 30: Result:= Player_Team_30; 31: Result:= Player_Team_31; 32: Result:= Player_Team_32; end;case PlayerID of 1: Result:= Player_Team_1; 2: Result:= Player_Team_2; 3: Result:= Player_Team_3; 4: Result:= Player_Team_4; 5: Result:= Player_Team_5; 6: Result:= Player_Team_6; 7: Result:= Player_Team_7; 8: Result:= Player_Team_8; 9: Result:= Player_Team_9; 10: Result:= Player_Team_10; 11: Result:= Player_Team_11; 12: Result:= Player_Team_12; 13: Result:= Player_Team_13; 14: Result:= Player_Team_14; 15: Result:= Player_Team_15; 16: Result:= Player_Team_16; 17: Result:= Player_Team_17; 18: Result:= Player_Team_18; 19: Result:= Player_Team_19; 20: Result:= Player_Team_20; 21: Result:= Player_Team_21; 22: Result:= Player_Team_22; 23: Result:= Player_Team_23; 24: Result:= Player_Team_24; 25: Result:= Player_Team_25; 26: Result:= Player_Team_26; 27: Result:= Player_Team_27; 28: Result:= Player_Team_28; 29: Result:= Player_Team_29; 30: Result:= Player_Team_30; 31: Result:= Player_Team_31; 32: Result:= Player_Team_32; end;end;procedure showVoteMenu(k,v: integer);beginkillLog[v] := k;voteTime[v] := 15;SayToPlayer(v, 'You have 15 seconds or to end of round to decide an action');SayToPlayer(v, '!1 - Forgive player');SayToPlayer(v, '!2 - Kill player now');SayToPlayer(v, '!3 - Kill player on next respawn');end;procedure AppOnIdle(Ticks: integer);beginvari: integer;beginif (NumPlayers > 0) then begin if (Ticks mod 60 = 0) then begin if killAtSpawn > 0 then killAtSpawn := killAtSpawn - 1; for i := 1 to 32 do begin if (spawnKill[i] = 1) and (killAtSpawn = 1) then begin Command('/kill ' + inttostr(i)); spawnKill[i] := 0; end; if voteTime[i] > 0 then voteTime[i] := voteTime[i] - 1; end; if killAtSpawn = 1 then killAtSpawn := 0; end;end;end;procedure OnJoinTeam(IP, Nickname: string;Team: byte);beginkills[NameToId(Nickname)] := 0;killLog[NameToId(Nickname)] := 0;spawnKill[NameToId(Nickname)] := 0;end;procedure OnLeaveGame(IP, Nickname: string;Team: byte);beginkills[NameToId(Nickname)] := 0;killLog[NameToId(Nickname)] := 0;spawnKill[NameToId(Nickname)] := 0;end;procedure OnPlayerKill(Killer,Victim,Weapon: string);varspree: array[1..17] of string;i: integer;j: integer;killsNeeded: integer;beginkillsNeeded := 5; //number of kills needed to count as a killing spree//spree[x] where x represents the current number of spree kills player has//more can be added just be sure to change the spree array sizespree[killsNeeded] := ' is on a Killing Spree!';spree[8] := ' is on a Rampage!';spree[11] := ' is Dominating!';spree[14] := ' is Unstoppable!';spree[17] := ' is Godlike!';i := NameToId(killer);j := NameToId(victim);if killer <> victim then begin //needed for servers with survival modeif (IDtoTeam(NameToId(killer)) <> IDtoTeam(NameToId(victim))) then beginkills[i] := kills[i] + 1;if (kills[j] >= killsNeeded) then beginCommand('/say ' + victim + '''s ' + inttostr(kills[j]) + ' kills spree ended by ' + killer);end;kills[j] := 0;if (kills[i] <= Arrayhigh(spree) + 1) then beginif (spree[kills[i]] <> '') then Command('/say ' + killer + spree[kills[i]]);end;endelse beginif (kills[i] > 0) then SayToPlayer(NameToId(killer), 'Your spree kills have been reset for team killing');kills[i] := 0;end;end;begin(IDtoTeam(NameToId(killer)) = IDtoTeam(NameToId(victim))) then showVoteMenu(NameToId(killer),NameToId(victim));end;procedure OnPlayerSpeak(Name,Text: string);beginarid: integer;beginid := NameToId(Name);if (Text = '!1') or (Text = '!2') or (Text = '!3') then begin if (killLog[id] > 0) and (voteTime[id] <> 0) then begin if (Text = '!1') then begin SayToPlayer(killLog[id], Name +' has forgiven you'); end else if (Text = '!2') then begin SayToPlayer(killLog[id], Name +' has chosen to kill you'); Command('/kill ' + inttostr(killLog[id])); end else begin SayToPlayer(killLog[id], Name +' has chosen to kill you on next respawn'); spawnKill[killLog[id]] := 1; end; SayToPlayer(id, 'Vote successful'); killLog[id] := 0; voteTime[id] := 0; end else begin SayToPlayer(id, 'You waited too long to vote'); killLog[id] := 0; voteTime[id] := 0; end;end;end;procedure OnPlayerRespawn(ID: integer);beginkillAtSpawn := 3;killLog[id] := 0;voteTime[id] := 0;end;procedure OnPlayerRespawn(ID: integer);beginkillAtSpawn := 3;killLog[id] := 0;voteTime[id] := 0;end;end;procedure OnPlayerRespawn(ID: integer);beginend;procedure ActivateServer();beginend;procedure OnCommand(ID: integer;Text: string);beginend;function OnRequestGame(IP: string;State: integer):integer;beginResult := State;end;procedure OnJoinGame(IP, Nickname: string;Team: byte);beginend;procedure OnFlagGrab(ID: integer;TeamFlag: byte;GrabbedInBase: boolean);beginend;procedure OnFlagReturn(ID: integer;TeamFlag: byte);beginend;procedure OnFlagScore(ID: integer;TeamFlag: byte);beginend;
(NetworkCore.pas) [Error] (116:1): Identifier expected
procedure AppOnIdle(Ticks: integer);beginvari: integer;beginif (NumPlayers > 0) then beginif (Ticks mod 60 = 0) then beginif killAtSpawn > 0 then killAtSpawn := killAtSpawn - 1;for i := 1 to 32 do beginif (spawnKill[i] = 1) and (killAtSpawn = 1) then beginCommand('/kill ' + inttostr(i));spawnKill[i] := 0;end;if voteTime[i] > 0 then voteTime[i] := voteTime[i] - 1;end;if killAtSpawn = 1 then killAtSpawn := 0;end;end;end;
begin(IDtoTeam(NameToId(killer)) = IDtoTeam(NameToId(victim))) then showVoteMenu(NameToId(killer),NameToId(victim));end;