0 Members and 1 Guest are viewing this topic.
var bots: array[1..16] of string;autobot: boolean;const numbots = 1; //Number of bots to joinmaxp = 4; //Maximum number of players (inc bot) for a bot to be kickedminp = 2; //Minumum number of players for a bot to be addedautobot := true; //Bot auto-joining on/offbots[1] := 'Admiral';bots[2] := 'Billy';bots[3] := 'Blain';bots[4] := 'Boogie Man';bots[5] := 'Commando';bots[6] := 'D Dave';bots[7] := 'Danko';bots[8] := 'Dutch';bots[9] := 'John';bots[10] := 'Kruger';bots[11] := 'Poncho';bots[12] := 'Roach';bots[13] := 'Sgt. Mac';bots[14] := 'Sniper';bots[15] := 'Stevie';bots[16] := 'Terminator';
procedure ActivateServer();var i: integer;begin for i := 1 to numbots do begin Command('/addbot ' + bots[i]); end;end;procedure AppOnIdle(Ticks: integer);var i: integer;begin //Check for num players then add or remove bot if autobot = true then begin if Ticks mod (30 * 60) = 0 then begin if ((NumPlayers >= maxp) and (NumBots >= numbots)) then begin for i := 1 to numbots do begin Command('/kick ' + bots[i]); end; end; if ((NumPlayers <= minp) and (NumBots = 0)) then begin for i := 1 to numbots do begin Command('/addbot ' + bots[i]); end; end; end; end;end;//if GetPiece(Text, ' ', 2) = CurrentMap thenfunction OnCommand(ID: Byte; Text: string): boolean;begin if Text = '/autobot' then begin if autobot = true then begin SayToPlayer(ID, '[*] Bot auto-joining is ON.'); end else begin SayToPlayer(ID, '[*] Bot auto-joining is OFF.'); end; end; if (GetPiece(Text, ' ', 2) = 'on') or (GetPiece(Text, ' ', 2) = '1') then begin autobot := true; SayToPlayer(ID, '[*] Bot auto-joining turned ON.'); end; if (GetPiece(Text, ' ', 2) = 'off') or (GetPiece(Text, ' ', 2) = '0') then begin autobot := false; SayToPlayer(ID, '[*] Bot auto-joining turned OFF.'); end; //NOTE: This function will be called when an admin types a / command. Result := false; // Return true if you want to ignore the command typed.end;
autobot := true; //Bot auto-joining on/offbots[1] := 'Admiral';bots[2] := 'Billy';bots[3] := 'Blain';bots[4] := 'Boogie Man';bots[5] := 'Commando';bots[6] := 'D Dave';bots[7] := 'Danko';bots[8] := 'Dutch';bots[9] := 'John';bots[10] := 'Kruger';bots[11] := 'Poncho';bots[12] := 'Roach';bots[13] := 'Sgt. Mac';bots[14] := 'Sniper';bots[15] := 'Stevie';bots[16] := 'Terminator';
[*] BotJoin -> [Error] (7:1): Duplicate identifier ''
const totalBots = 1; //Number of bots to join maxp = 4; //Maximum number of players (inc bot) for a bot to be kicked minp = 2; //Minumum number of players for a bot to be addedvar bots: array[1..16] of string; autobot: boolean;procedure ActivateServer();var i: integer;begin autobot := true; //Bot auto-joining on/off bots[1] := 'Admiral'; bots[2] := 'Billy'; bots[3] := 'Blain'; bots[4] := 'Boogie Man'; bots[5] := 'Commando'; bots[6] := 'D Dave'; bots[7] := 'Danko'; bots[8] := 'Dutch'; bots[9] := 'John'; bots[10] := 'Kruger'; bots[11] := 'Poncho'; bots[12] := 'Roach'; bots[13] := 'Sgt. Mac'; bots[14] := 'Sniper'; bots[15] := 'Stevie'; bots[16] := 'Terminator'; for i := 1 to totalBots do begin Command('/addbot ' + bots[i]); endend;procedure AppOnIdle(Ticks: integer);var i: integer;begin//Check for num players then add or remove bot if autobot = true then begin if Ticks mod (30 * 60) = 0 then begin if ((NumPlayers >= maxp) and (totalBots >= totalBots)) then begin for i := 1 to totalBots do begin Command('/kick ' + bots[i]); end end if ((NumPlayers <= minp) and (totalBots = 0)) then begin for i := 1 to numbots do begin Command('/addbot ' + bots[i]); end end end endend;function OnCommand(ID: Byte; Text: string): boolean;begin if Text = '/autobot' then begin if autobot = true then begin SayToPlayer(ID, '[*] Bot auto-joining is ON.'); end else begin SayToPlayer(ID, '[*] Bot auto-joining is OFF.'); end end if (GetPiece(Text, ' ', 2) = 'on') or (GetPiece(Text, ' ', 2) = '1') then begin autobot := true; SayToPlayer(ID, '[*] Bot auto-joining turned ON.'); end if (GetPiece(Text, ' ', 2) = 'off') or (GetPiece(Text, ' ', 2) = '0') then begin autobot := false; SayToPlayer(ID, '[*] Bot auto-joining turned OFF.'); end //NOTE: This function will be called when an admin types a / command. Result := false; // Return true if you want to ignore the command typed.end;