Hi, I've again made a plugin I'm about to present here.
This is a plugin that kills bots by executing the given command when all humans are dead. You have to specify the command in a cvar and the script will execute this command SERVERSIDE when the last alive human dies or disconnects.
After the Bomb has been planted, the script automatically switches itself inactive (unless you set the cvar to override this) and the bots will be able to finish the round if the last human dies, so they get the chance to defuse.
To make life easier for server admins, I decided to implement a command that will kill all bots immediately when an Admin executed the command. This is helpful cuz Admins will only have to know a single command that will work for every bot, and the Admins won't have to be told a new command if the server owner changes the bot engine.
Example: An server owner is running Z-Bot but comes to the conclusion that he likes ePODbot much better, so he throws ZBot out and installs ePODbot. Now the other admins (if there are any) have to be told a new cmd to kill the bots. With my plugin, the others are still able to use the old command and won't need to change binds etc.
Default admin rights needed to exec the command is ADMIN_SLAY.
I've updated the old .sma to support a complete bot management. It can still kill the bots when the last human player dies and the cvars for this feature haven't changed, so you won't have to change anything in order to use the new version, but now this script is also able to add / remove bots in order to have a certain number of players on each team. I added this feature because many bots simply don't support it and some bots support it quite poorly, removing a CT bot if there are too many terrs and so on...
The following CVars and commands exist:
amx_killbots_cmd <-- command used to kill the bots. It is executed when the last human player dies.
amx_killbots_cmd_addt <-- command used to add a Terrorist bot. Executed to establish teams.
amx_killbots_cmd_addct <-- command used to add a CT bot. Executed to establish teams.
amx_killbots_cmd_remt <-- command used to remove a Terrorist bot. Executed to establish teams.
amx_killbots_cmd_remct <-- command used to remove a CT bot. Executed to establish teams.
amx_rembots_bykick <-- if set to 1, the cmd set in amx_killbots_cmd_rem(c)t is ignored and the bots are simply kicked.
amx_killbots_teamsize <-- number of players per team - e.g. if set to 5, the script will try to establish a 5on5 game.
amx_killbots_enable <-- enables / disables killing of the bots.
amx_killbots_enableadd <-- enables / disables adding & removing of bots.
amx_killbots_ignorebomb <-- if set to 0 (off), bots will not be killed after the bomb was planted, so they will be able to defend / defuse it.
amx_killbots_now <-- exec this to kill the bots immediately no matter if bomb was planted or not.
amx_addbott_now <-- adds a T bot to the game. Warning: if team management is on, this bot maybe removed next round start!
amx_addbotct_now <-- adds a CT bot to the game.
amx_rembott_now <-- removes a T bot from the game.
amx_rembotct_now <-- removes a CT bot from the game.
the commands to kill, add and remove the bots immediately just execute the commands you specified in the CVars. If you enabled remove by kick, the remove commands will kick your bots and not try to exec the cmds.
On every round start, the script checks how many players there are in each team. If the player count differs from the value given in the CVar "amx_killbots_teamsize", the script tries to compensate these differences by adding / removing bots. If the team has "too many" players with no bots, the script can't help it so nothing will happen.
The removing methods depend on what you set in the cvars. Usually, the script will execute the specified command and hope that this solved the problem. If you enabled "remove by kick", the script asks the server to kick a few players known as bots. If this works mainly depends on you to set the right cvar settings.
This whole script was tested with JoeBot (that is why the default CVars are JoeBot commands), but I think it should work with any other bot as well if the right commands are specified. You can change all the CVars' names and defaults without having to edit the whole script, just edit the #defines on the top few lines and recompile. You can even edit the format of the HUD messages by only editing a #define.
I used a dictionary for the HUD messages. If anyone translated parts of it into their native language, please send me. I will update this thread so everyone can use it. The languages currently supported are English and German.
Idea, Coding & Testing by MistaGee (=/me :p )
sent me a romanian translation of the plugin's texts today, so I added it to the dictionary file. Thanks