0 Members and 1 Guest are viewing this topic.
var Slot: byte;procedure AddBot(Team: byte);var i: byte;begin Sleep(10); Slot := 0; i := 1; while (Slot = 0) and (i <= 32) do if GetPlayerStat(i,'Active') = false then Slot := i else i := i + 1; if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then Command('/addbot ' + RandomBot) else Command('/addbot' + InttoStr(Team) + ' ' + RandomBot); BotChat(Slot,'Welcome! Sense there is nobody else here, so I''ll entertain you for a little while.');end;procedure OnJoinTeam(ID, Team: byte);var BotTeam: byte;begin if Team = 1 then BotTeam := 2 else BotTeam := 1; if GetPlayerStat(ID,'Human') = true then Case NumPlayers of 1: if Slot = 0 then ThreadFunc([BotTeam],'AddBot'); 3: if (GetPlayerStat(Slot,'Human') = false) and (Slot <> 0) then KickPlayer(Slot); end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin if (GetPlayerStat(ID,'Human') = true) and (NumPlayers = 2) and (Slot = 0) then ThreadFunc([Team],'AddBot'); if (GetPlayerStat(ID,'Human') = true) and (GetPlayerStat(Slot,'Human') = false) and (Slot <> 0) then KickPlayer(Slot); if ID = Slot then Slot := 0;end;
I tried to combine this with the template and it just says "Line #25 -> end;"I'll check if its my error....I manually combined a template with this script and it doesn't crash, and seems to work perfectly fine.
So, when someone else joins, the bot is autokicked, as well?
var Slot: byte;procedure AddBot(Team: byte);begin Sleep(10); if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then Slot := Command('/addbot ' + RandomBot) else Slot := Command('/addbot' + InttoStr(Team) + ' ' + RandomBot); BotChat(Slot,'Welcome! Sense there is nobody else here, so I''ll entertain you for a little while.');end;procedure OnJoinTeam(ID, Team: byte);var BotTeam: byte;begin if Team = 1 then BotTeam := 2 else BotTeam := 1; if GetPlayerStat(ID,'Human') = true then Case NumPlayers of 1: if Slot = 0 then ThreadFunc([BotTeam],'AddBot'); 3: if (GetPlayerStat(Slot,'Human') = false) and (Slot <> 0) then KickPlayer(Slot); end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin if (GetPlayerStat(ID,'Human') = true) and (NumPlayers = 2) and (Slot = 0) then ThreadFunc([Team],'AddBot'); if (GetPlayerStat(ID,'Human') = true) and (GetPlayerStat(Slot,'Human') = false) and (Slot <> 0) then KickPlayer(Slot); if ID = Slot then Slot := 0;end;
I think that same function is in server.ini. It's called botbalance but I' m not sure if it kicks bots too.
This is perhaps the saddest code I have ever seen. If your alone in a server then you have no friends xD.
wot? There's a botbalance function? haha i never knew that!Sry DD... I hate when that happens...
for the original scriptwriter, hey, maybe there's still gold in your script. Could you make it so that it adds one bot, you kill him, and it adds 2, you kill them, it adds 3... etc... resets when you die, and you play it for high score. Or something... anyways, just tryin to cheer u up.
FFS! When did this happen?I set botbalanceteams=1 in server.ini on my TM server. Nothing happened. Help?
I Like the script. it looks good.
i think its buggy too