Raised This Month: $12 Target: $400
 3% 

[CS:GO] [CS:S] Bot Toggle (v1.0.1, 2015-10-21)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
decowboy
AlliedModders Donor
Join Date: Oct 2015
Location: Guadalajara, Mexico
Plugin ID:
4851
Plugin Version:
v1.0.1
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allow players to enable/disable bots with a simple chat command
    Old 10-15-2015 , 23:55   [CS:GO] [CS:S] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #1

    Bot Toggle v1.0.1


    Description

    ----------------------------------------------------

    Sometimes people like to play with bots and sometimes people like to play without them.
    This plugin offers players an easy way of toggling bots on or off: a simple chat command.

    Bot Toggle is plain simple in its use, works out-of-the-box and can be customized with cvars.
    It was written to be as straight forward as possible.

    Even if you're already using a plugin to manage the bots, this plugin could be a nice addition to your server,
    offering players an alternative way to easily enable or disable bots,
    without anyone having to navigate a menu or the console.






    Features

    ----------------------------------------------------

    - Players can toggle bots on and off with a chat command.

    - Set whether bots should be on or off by default.
    - Customize the command that players use to toggle the bots.

    - Automatically announce to players in chat how they can toggle the bots.
    - Limit the toggling of bots to the first x rounds of the match.
    - Allow admins to toggle when other players can't.

    - Automatically disable when there are so many players that bots aren't needed.
    - Log to the server console when a player toggles the bots.

    - Listens to the standard bot_quota and bot_quota_mode cvars.



    How does it work?
    ----------------------------------------------------

    You can modify the behaviour of Bot Toggle using the cvars below, but this is how the plugin would work by default:

    1. A new map is loaded.
    2. A certain number of bots spawn, corresponding with the bot_quota and bot_quota_mode cvars.
    3. Players join and the plugin announces itself in chat.
    4. Players say /bots or !bots in chat to toggle the bots off (or on).
    5. Bots leave (or join).

    After a player toggles the bots, nobody will be able to toggle them for 6 seconds, with the exception of players with the admin generic flag. This is to prevent flooding.

    After 2 rounds have been played, players can no longer toggle the bots, with the exception of players with the admin generic flag. This is to prevent abuse.

    If the bot_quota_mode cvar is set to fill and the value of the bot_quota cvar is equal to or lower than the amount of human players, there won't be any bots regardless of how they're toggled.
    The plugin would remain silent and inactive until enough players leave, the bot_quota cvar is increased or bots are manually added.



    Cvars
    ----------------------------------------------------

    In addition to the cvars below, you will need to set the bot_quota and bot_quota_mode cvars to your liking.
    If the bot_quota cvar is set to 0, then this plugin will disable itself.

    Quote:
    bot_quota - Set to # of bots allowed on server
    bot_quota_mode - Determines the type of quota. Allowed values: 'normal' and 'fill'. If 'fill', the server will adjust bots to keep N players in the game, where N is bot_quota.
    Quote:
    sm_bot_toggle - Should players be allowed to toggle bots? (0/1; default: 1)
    sm_bot_toggle_default - Should bots automatically spawn when a new map is loaded? (0/1; default: 1)
    sm_bot_toggle_command - Command for players to toggle bots with (do *not* prepend with exclamation mark or slash; max. 32 characters; default: "bots")
    sm_bot_toggle_chat - Should the use of the toggle command in chat without an exclamation mark or slash in front of it be allowed? (0/1; default: 0)
    sm_bot_toggle_announce - Announce the toggle command to players in chat? (0/1; default: 1)
    sm_bot_toggle_rounds - Only allow players to toggle bots during the first x rounds of the match (-1 or 0 = always allow; default: 2)
    sm_bot_toggle_cooldown - Do not allow players to toggle bots for x seconds after the previous toggle (-1 or 0 = always allow; default: 6)
    sm_bot_toggle_flag - Allow admins with this flag to toggle even if other players can't (e.g. "kick" for admin kick flag; max. 32 characters; leave empty to disable; default: "generic")



    Compatibility

    ----------------------------------------------------

    Bot Toggle uses the standard bot-related cvars, which means it is compatible with plugins that use bot_quota, bot_kick, bot_add, etc. to regulate the amount of bots. Most plugins do.

    Plugins that add or remove bots without it being reflected in the value of the bot_quota cvar aren't compatible with this plugin.



    Changelog

    ----------------------------------------------------

    v1.0.1 (2015-10-21, changes)
    - Fix for "Client index is invalid"
    - Updated to new-style declarations
    - Allow changing the toggle command on-the-fly
    - Minor improvements and code cleanup

    v1.0 (2015-10-16) // 62 downloads
    - Initial release



    Notes

    ----------------------------------------------------

    It would be great if you'd care to report any bugs or incompatibilities you find.



    Attached Files
    File Type: sp Get Plugin or Get Source (bottoggle.sp - 2685 views - 20.1 KB)

    Last edited by decowboy; 06-15-2017 at 09:00. Reason: compatible with cs:s
    decowboy is offline
    decowboy
    AlliedModders Donor
    Join Date: Oct 2015
    Location: Guadalajara, Mexico
    Old 10-21-2015 , 00:05   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #2

    Just uploaded v1.0.1 which fixes a bug where "Client index is invalid"-errors could occur.
    If you're running this plugin I recommend you update it.

    All cvars remain the same.
    decowboy is offline
    3axap
    Member
    Join Date: Dec 2012
    Old 03-19-2016 , 18:10   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #3

    All sm_bot_xxx command not found :/. And one more question. Where i cat write config with this:

    Quote:
    sm_bot_toggle 1 // Should players be allowed to toggle bots? (0/1; default: 1)
    sm_bot_toggle_default 0 // Should bots automatically spawn when a new map is loaded? (0/1; default: 1)
    sm_bot_toggle_command // Command for players to toggle bots with (do *not* prepend with exclamation mark or slash; max. 32 characters; default: "bots")
    sm_bot_toggle_chat 0 // Should the use of the toggle command in chat without an exclamation mark or slash in front of it be allowed? (0/1; default: 0)
    sm_bot_toggle_announce 1 // Announce the toggle command to players in chat? (0/1; default: 1)
    sm_bot_toggle_rounds 0 // Only allow players to toggle bots during the first x rounds of the match (-1 or 0 = always allow; default: 2)
    sm_bot_toggle_cooldown 120 //- Do not allow players to toggle bots for x seconds after the previous toggle (-1 or 0 = always allow; default: 6)
    // sm_bot_toggle_flag - Allow admins with this flag to toggle even if other players can't (e.g. "kick" for admin kick flag; max. 32 characters; leave empty to disable; default: "generic")
    3axap is offline
    3axap
    Member
    Join Date: Dec 2012
    Old 03-19-2016 , 18:13   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #4

    And what is int humanCount = 0; // current number of human players ? Can mod kick all bots, if players on servers fill 2 slot, or 3?
    if clients 0 = bot_quote 10
    if clients >1 = bot_quote 0
    3axap is offline
    decowboy
    AlliedModders Donor
    Join Date: Oct 2015
    Location: Guadalajara, Mexico
    Old 04-10-2016 , 20:30   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #5

    Quote:
    Originally Posted by 3axap View Post
    All sm_bot_xxx command not found :/.
    I run this plugin on my private servers and all cvars work fine. It seems to me you haven't properly installed the plugin or something. If you look at the code, there is really no reason why those cvars wouldn't exist. Download the compiled .smx plug-in file and copy it to addons\sourcemod\plugins.

    Quote:
    Originally Posted by 3axap View Post
    Where i cat write config with this
    Sourcemod automatically creates a config file for plugins. Just start your server once with this plugin in your plugins folder and the config file would appear in csgo\cfg\sourcemod. It is named plugin_bot_toggle.cfg.

    Quote:
    Originally Posted by 3axap View Post
    And what is int humanCount = 0; // current number of human players ?
    The variable humanCount holds the current number of human players in the server. This is the same as saying all players in the server excluding bots, GOTV, spectators, etc. Honestly, it's pretty self-explanatory. Have a look at the functions UpdatePlayerCount() and IsParticipatingPlayer().

    Quote:
    Originally Posted by 3axap View Post
    Can mod kick all bots, if players on servers fill 2 slot, or 3?
    This plugin allows the players in your server to enable or disable bots with a chat command. You could set it up so that there are 10 bots on your server and players may choose to remove them manually.

    Last edited by decowboy; 04-10-2016 at 20:36.
    decowboy is offline
    napster_10
    Senior Member
    Join Date: May 2016
    Old 05-16-2016 , 12:48   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #6

    awesome but can someone explain what to do if i want to have a voting to kick bots?

    like rockthevote to change map

    - a set percentage of player have to type in !bots or something like that
    - after reaching the number vote will start by asking "kick the bots?"
    - then u can confirm with yes/no
    - and a set percentage of player is needed for yes to finally kick the bots

    same for adding bots

    can someone help or write this plugin?
    napster_10 is offline
    3axap
    Member
    Join Date: Dec 2012
    Old 06-15-2017 , 01:57   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #7

    decowboy, thank you! Can i find same plugin for CSS? Realy cool stuff!
    3axap is offline
    decowboy
    AlliedModders Donor
    Join Date: Oct 2015
    Location: Guadalajara, Mexico
    Old 06-15-2017 , 08:53   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #8

    Thanks for the kind words!
    I think this would work fine for Counter-Strike Source, but you'll have to try to be sure. I don't have that game myself.
    decowboy is offline
    3axap
    Member
    Join Date: Dec 2012
    Old 06-15-2017 , 08:58   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #9

    Quote:
    Originally Posted by decowboy View Post
    Thanks for the kind words!
    I think this would work fine for Counter-Strike Source, but you'll have to try to be sure. I don't have that game myself.
    Thank you, work fine! ) You can edit title and add CSS compatible)

    Last edited by 3axap; 06-15-2017 at 08:59.
    3axap is offline
    decowboy
    AlliedModders Donor
    Join Date: Oct 2015
    Location: Guadalajara, Mexico
    Old 06-15-2017 , 08:58   Re: [CS:GO] Bot Toggle (v1.0.1, 2015-10-21)
    Reply With Quote #10

    Great! Thanks for letting me know!
    decowboy is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 04:36.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode