0 Members and 2 Guests are viewing this topic.
var Bot: byte;procedure OnJoinTeam(ID, Team: byte);begin if (Team = 1) or (Team = 2) then begin if NumPlayers = 1 then begin Bot:= Command('/addbot' + iif(Team = 1,'2','1') + ' ' + RandomBot()); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else if GetPlayerStat(Bot,'Active') = true then KickPlayer(Bot); end;end;
Code: [Select]var Bot: byte;procedure OnJoinTeam(ID, Team: byte);begin if (Team = 1) or (Team = 2) then begin if NumPlayers = 1 then begin Bot:= Command('/addbot' + iif(Team = 1,'2','1') + ' ' + RandomBot()); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else if GetPlayerStat(Bot,'Active') = true then KickPlayer(Bot); end;end;Should work.
procedure BotFriend();begin if AlphaPlayers + BravoPlayers = 1 then begin Bot:= Command('/addbot' + iif(AlphaPlayers = 1,'2','1') + ' ' + RandomBot()); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else if GetPlayerStat(Bot,'Active') = true then KickPlayer(Bot);end;procedure OnJoinTeam(ID, Team: byte);begin BotFriend();end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin BotFriend();end;
could also make it add a bot named "Envy" instead of a random bot. I already have the Envy.bot file.Bot:= Command('/addbot Envy' + iif(Team = 1,'2','1') + ' ' + RandomBot());this should do the job
Bot:= Command('/addbot' + iif(Team = 1,'2','1') + ' Envy');
yeah, his code currently doesn't account for player leaving (which you didn't ask for )here try this:var Bot: byte;Code: [Select]procedure BotFriend();begin if AlphaPlayers + BravoPlayers = 1 then begin Bot:= Command('/addbot' + iif(AlphaPlayers = 1,'2','1') + ' ' + RandomBot()); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else if GetPlayerStat(Bot,'Active') = true then KickPlayer(Bot);end;procedure OnJoinTeam(ID, Team: byte);begin BotFriend();end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin BotFriend();end;this fixes 2 things: 1) he didn't have code for if the player leaves - 2) he didn't have code for if the player changes teams to Spectatoralso note:this code will disregard players on charlie or deltathis code might mess up if one bot is placed in server when the server initializes
(14:30:26) Danko has been kicked. (14:30:26) Danko has been kicked. (14:30:26) Danko has been kicked. (14:30:26) Danko has been kicked. (14:30:26) Danko has been kicked. (14:30:26) Danko has been kicked. (14:30:26) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:27) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:28) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:29) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:30) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:31) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:32) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:33) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:34) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:35) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:36) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:37) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:38) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:39) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:40) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:41) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:42) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:43) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:44) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:45) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:46) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:47) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:48) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:49) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:50) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:51) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:52) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:53) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:54) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:55) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:56) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:57) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:58) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:30:59) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:00) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:01) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:02) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:03) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:04) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:05) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:06) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:07) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:08) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:09) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:10) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:11) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:12) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:13) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:14) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:15) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked. (14:31:16) Danko has been kicked.
Code: [Select]Bot:= Command('/addbot' + iif(Team = 1,'2','1') + ' Envy');
// Adds bot named "Envy" in team-games when someone is on alpha or bravo, and no opponent in bravo or alpha respectively.var BotTeam,Bot: byte; procedure ActivateServer();begin Bot := 0; BotTeam := 0end;procedure OnJoinTeam(ID, Team: byte); // player joins team prior to procedurebegin if (ID <> Bot) then begin if (Bot = 0) and (AlphaPlayers + BravoPlayers = 1) then begin BotTeam := iif(AlphaPlayers = 1,2,1) Bot := Command('/addbot' + inttostr(BotTeam) + ' Envy'); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else begin if (AlphaPlayers = 2) and (BravoPlayers = 0) then begin BotTeam := 2; Command('/setteam' + inttostr(BotTeam) + ' ' + inttostr(Bot)); end else if (AlphaPlayers = 0) and (BravoPlayers = 2) then begin BotTeam := 1; Command('/setteam' + inttostr(BotTeam) + ' ' + inttostr(Bot)); end else if (AlphaPlayers = 1) and (BravoPlayers = 1) then begin KickPlayer(Bot); Bot := 0; end else if (AlphaPlayers + BravoPlayers = 1) then begin KickPlayer(Bot); Bot := 0; end; end; end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean); // player leaves game after procedurebegin if (ID <> Bot) then begin if ((Team = 1) or (Team = 2)) then begin if AlphaPlayers + BravoPlayers = 2 then begin if Bot = 0 then begin BotTeam := iif(Team = 1,1,2) Bot := Command('/addbot' + inttostr(BotTeam) + ' Envy'); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else begin KickPlayer(Bot); Bot := 0; end; end; end; end;end;
HEY done!this took me longer than expected - haven't done scripting in over a year or so, so this was a good way to get back (can't wait till new version comes out!)anyway here's the script:Code: [Select]// Adds bot named "Envy" in team-games when someone is on alpha or bravo, and no opponent in bravo or alpha respectively.var BotTeam,Bot: byte; procedure ActivateServer();begin Bot := 0; BotTeam := 0end;procedure OnJoinTeam(ID, Team: byte); // player joins team prior to procedurebegin if (ID <> Bot) then begin if (Bot = 0) and (AlphaPlayers + BravoPlayers = 1) then begin BotTeam := iif(AlphaPlayers = 1,2,1) Bot := Command('/addbot' + inttostr(BotTeam) + ' Envy'); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else begin if (AlphaPlayers = 2) and (BravoPlayers = 0) then begin BotTeam := 2; Command('/setteam' + inttostr(BotTeam) + ' ' + inttostr(Bot)); end else if (AlphaPlayers = 0) and (BravoPlayers = 2) then begin BotTeam := 1; Command('/setteam' + inttostr(BotTeam) + ' ' + inttostr(Bot)); end else if (AlphaPlayers = 1) and (BravoPlayers = 1) then begin KickPlayer(Bot); Bot := 0; end else if (AlphaPlayers + BravoPlayers = 1) then begin KickPlayer(Bot); Bot := 0; end; end; end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean); // player leaves game after procedurebegin if (ID <> Bot) then begin if ((Team = 1) or (Team = 2)) then begin if AlphaPlayers + BravoPlayers = 2 then begin if Bot = 0 then begin BotTeam := iif(Team = 1,1,2) Bot := Command('/addbot' + inttostr(BotTeam) + ' Envy'); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else begin KickPlayer(Bot); Bot := 0; end; end; end; end;end;This takes care of everything.If alpha player is playing against bravo bot, and the player joins bravo, bot joins alpha.If alpha player is playing against bravo bot, and the player joins charlie/delta/spectator, bot leavesBot leaves when no one in server.Joining Bot is Envy (you must have such bot file, or no bot gets added)and everything else too!
// Adds bot named "Envy" in team-games when someone is on alpha or bravo, and no opponent in bravo or alpha respectively.var BotTeam,Bot: byte; procedure ActivateServer();begin Bot := 0; BotTeam := 0end;procedure OnJoinTeam(ID, Team: byte); // player joins team prior to procedurebegin if (ID <> Bot) then begin if (Bot = 0) and (AlphaPlayers + BravoPlayers = 1) then begin BotTeam := iif(AlphaPlayers = 1,2,1) Bot := Command('/addbot' + inttostr(BotTeam) + ' Envy'); // ' Envy' or ' ' + RandomBot() WriteLn('FriendBot ' + IDToName(Bot) + ' added.'); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else begin if (AlphaPlayers = 2) and (BravoPlayers = 0) and (BotTeam = 1) then begin BotTeam := 2; Command('/setteam2 ' + inttostr(Bot)); end else if (AlphaPlayers = 0) and (BravoPlayers = 2) and (BotTeam = 2) then begin BotTeam := 1; Command('/setteam1 ' + inttostr(Bot)); end else if (AlphaPlayers + BravoPlayers > 2) then begin KickPlayer(Bot); Bot := 0; // Balances Alpha and Bravo - to take out, simply put // in front: if (Team = iif(BotTeam=1,2,1)) then Command('/setteam' + inttostr(BotTeam) + ' ' + inttostr(ID)); end else if (AlphaPlayers + BravoPlayers = 1) then begin KickPlayer(Bot); Bot := 0; end; end; end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean); // player leaves game after procedurebegin if (ID <> Bot) then begin if ((Team = 1) or (Team = 2)) then begin if AlphaPlayers + BravoPlayers = 2 then begin if Bot = 0 then begin BotTeam := iif(Team = 1,1,2) Bot := Command('/addbot' + inttostr(BotTeam) + ' Envy'); // ' Envy' or ' ' + RandomBot() WriteLn('FriendBot ' + IDToName(Bot) + ' added.'); WriteConsole(0,'Say hello to ' + IDToName(Bot) + ', he will keep you entertained until someone else joins.',$AAAA00); end else begin KickPlayer(Bot); Bot := 0; end; end; end; end;end;
haha sorry didn't test for that. this should (finally) be it.
Note: First player joins Alpha. Bot joins Bravo. If a new player also joins Alpha (and Bravo Bot gets kicked) that player will be put on Bravo automatically. To remove this feature open script in notepad and make a search for "Balances" and read!
Code: [Select]// Balances Alpha and Bravo - to take out, simply put // in front:// if (Team = iif(BotTeam=1,2,1)) then Command('/setteam' + inttostr(BotTeam) + ' ' + inttostr(ID));
// Balances Alpha and Bravo - to take out, simply put // in front:// if (Team = iif(BotTeam=1,2,1)) then Command('/setteam' + inttostr(BotTeam) + ' ' + inttostr(ID));
Here you can find a proper version of the requested script.