- fixed up plugin headers a tiny bit
authorDavid Anderson <dvander@alliedmods.net>
Tue Jun 26 00:03:54 2007 +0000 (2007-06-26)
changeset 133f35cdcf6955
parent 12 f3fedcdb9bd4
child 14 921cec01f787
- fixed up plugin headers a tiny bit
- added the ol' join advertisement back in
- added bot quota plugin in
cfg/cssdm.cfg
changelog.txt
scripting/dm_basics.sp
scripting/dm_bot_quotas.sp
scripting/dm_equipment.sp
scripting/dm_spawn_protection.sp
     1.1 --- a/cfg/cssdm.cfg	Mon Jun 25 23:43:20 2007 +0000
     1.2 +++ b/cfg/cssdm.cfg	Tue Jun 26 00:03:54 2007 +0000
     1.3 @@ -96,3 +96,13 @@
     1.4  // Requires: dm_basics.smx
     1.5  // Default: "1"
     1.6  cssdm_refill_ammo "1"
     1.7 +
     1.8 +// Sets how many bots CS:S DM keeps in game.  Use this instead
     1.9 +// of bot_quota for managing bots.
    1.10 +// bot_quota should be "0"
    1.11 +// bot_quota_mode should be "normal"
    1.12 +// bot_auto_vacate should be "0"
    1.13 +// -- 
    1.14 +// Requires: dm_bot_quotas.smx
    1.15 +// Default: "0"
    1.16 +cssdm_bots_balance "0"
    1.17 \ No newline at end of file
     2.1 --- a/changelog.txt	Mon Jun 25 23:43:20 2007 +0000
     2.2 +++ b/changelog.txt	Tue Jun 26 00:03:54 2007 +0000
     2.3 @@ -21,6 +21,7 @@
     2.4  	- Added a "Random Weapons" feature to the weapon menus.
     2.5  	- Removed the grenade and armor menus.
     2.6  	- Added a new interactive spawn point editor ("cssdm_spawn_menu").
     2.7 +	- Added a plugin to manage bot_quota correctly.
     2.8  	- Removed cssdm_addspawn.
     2.9  	- Improved bot support for automatic items.
    2.10  	- Fixed a bug where C4 would be removed when CS:S DM was disabled.
     3.1 --- a/scripting/dm_basics.sp	Mon Jun 25 23:43:20 2007 +0000
     3.2 +++ b/scripting/dm_basics.sp	Tue Jun 26 00:03:54 2007 +0000
     3.3 @@ -2,6 +2,7 @@
     3.4   * dm_basics.sp
     3.5   * Base CS:S DM admin/control functions.
     3.6   * This file is part of CS:S DM, Copyright (C) 2005-2007 AlliedModders LLC
     3.7 + * by David "BAILOPAN" Anderson, http://www.bailopan.net/cssdm/
     3.8   *
     3.9   * This program is free software; you can redistribute it and/or
    3.10   * modify it under the terms of the GNU General Public License
    3.11 @@ -205,9 +206,25 @@
    3.12  	return Plugin_Stop;
    3.13  }
    3.14  
    3.15 +public Action:Timer_Welcome(Handle:timer, any:userid)
    3.16 +{
    3.17 +	new client = GetClientOfUserId(userid);
    3.18 +	
    3.19 +	if (!client || !IsClientInGame(client))
    3.20 +	{
    3.21 +		return Plugin_Stop;
    3.22 +	}
    3.23 +	
    3.24 +	PrintToChat(client, "[CSSDM] Counter-Strike Source: Deathmatch (version %s)", CSSDM_VERSION);
    3.25 +	PrintToChat(client, "[CSSDM] Visit http://www.bailopan.net/cssdm/ to download.");
    3.26 +	
    3.27 +	return Plugin_Stop;
    3.28 +}
    3.29 +
    3.30  public OnClientPutInServer(client)
    3.31  {
    3.32  	g_DeathTimes[client] = 0.0;
    3.33 +	CreateTimer(10.0, Timer_Welcome, GetClientUserId(client));
    3.34  }
    3.35  
    3.36  public Action:DM_OnClientDeath(client)
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/scripting/dm_bot_quotas.sp	Tue Jun 26 00:03:54 2007 +0000
     4.3 @@ -0,0 +1,97 @@
     4.4 +/**
     4.5 + * dm_bot_quotas.sp
     4.6 + * Adds bot quota correction to CS:S DM.
     4.7 + * This file is part of CS:S DM, Copyright (C) 2005-2007 AlliedModders LLC
     4.8 + * by David "BAILOPAN" Anderson, http://www.bailopan.net/cssdm/
     4.9 + *
    4.10 + * This program is free software; you can redistribute it and/or
    4.11 + * modify it under the terms of the GNU General Public License
    4.12 + * as published by the Free Software Foundation; either version 2
    4.13 + * of the License, or (at your option) any later version.
    4.14 + *
    4.15 + * This program is distributed in the hope that it will be useful,
    4.16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.18 + * GNU General Public License for more details.
    4.19 + * 
    4.20 + * You should have received a copy of the GNU General Public License
    4.21 + * along with this program; if not, write to the Free Software
    4.22 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    4.23 + *
    4.24 + * Version: $Id$
    4.25 + */
    4.26 +
    4.27 +
    4.28 +#include <sourcemod>
    4.29 +
    4.30 +public Plugin:myinfo = 
    4.31 +{
    4.32 +	name = "CS:S DM Bot Quotas",
    4.33 +	author = "BAILOPAN",
    4.34 +	description = "Bot Quota Correction for CS:S DM",
    4.35 +	version = "2.0.0.0",
    4.36 +	url = "http://www.bailopan.net/cssdm/"
    4.37 +}
    4.38 +
    4.39 +/* CS:S ConVars */
    4.40 +new Handle:BotQuota = INVALID_HANDLE
    4.41 +
    4.42 +/* Our ConVars */
    4.43 +new Handle:BalanceAmt = INVALID_HANDLE
    4.44 +
    4.45 +public OnPluginStart()
    4.46 +{
    4.47 +	/* Find CS:S ConVars */
    4.48 +	BotQuota = FindConVar("bot_quota")
    4.49 +	
    4.50 +	/* Create our ConVars */
    4.51 +	BalanceAmt = CreateConVar("cssdm_bots_balance", "0", "Minimum number of players (bot_quota)")
    4.52 +	HookConVarChange(BalanceAmt, OnBalanceChange)
    4.53 +}
    4.54 +
    4.55 +public OnBalanceChange(Handle:convar, const String:oldval[], const String:newval[])
    4.56 +{
    4.57 +	BalanceBots(StringToInt(newval))
    4.58 +}
    4.59 +
    4.60 +BalanceBots(quota)
    4.61 +{
    4.62 +	new maxClients = GetMaxClients()
    4.63 +	new humans, bots
    4.64 +	
    4.65 +	/* Get the number of valid humans and bots */
    4.66 +	for (new i=1; i<=maxClients; i++)
    4.67 +	{
    4.68 +		if (!IsPlayerInGame(i))
    4.69 +		{
    4.70 +			continue
    4.71 +		}
    4.72 +		if (!IsFakeClient(i))
    4.73 +		{
    4.74 +			humans++
    4.75 +		} else {
    4.76 +			bots++
    4.77 +		}
    4.78 +	}
    4.79 +	
    4.80 +	/* Get the number of bots needed to fill quota */
    4.81 +	if (quota < humans)
    4.82 +	{
    4.83 +		quota = 0
    4.84 +	} else {
    4.85 +		quota -= humans
    4.86 +	}
    4.87 +	
    4.88 +	/* Now, set the new value */
    4.89 +	SetConVarInt(BotQuota, quota)
    4.90 +}
    4.91 +
    4.92 +public OnClientPutInServer(client)
    4.93 +{
    4.94 +	BalanceBots(GetConVarInt(BalanceAmt))
    4.95 +}
    4.96 +
    4.97 +public OnClientDisconnect_Post(client)
    4.98 +{
    4.99 +	BalanceBots(GetConVarInt(BalanceAmt))
   4.100 +}
     5.1 --- a/scripting/dm_equipment.sp	Mon Jun 25 23:43:20 2007 +0000
     5.2 +++ b/scripting/dm_equipment.sp	Tue Jun 26 00:03:54 2007 +0000
     5.3 @@ -2,6 +2,7 @@
     5.4   * dm_equipment.sp
     5.5   * Adds preset spawning to CS:S DM.
     5.6   * This file is part of CS:S DM, Copyright (C) 2005-2007 AlliedModders LLC
     5.7 + * by David "BAILOPAN" Anderson, http://www.bailopan.net/cssdm/
     5.8   *
     5.9   * This program is free software; you can redistribute it and/or
    5.10   * modify it under the terms of the GNU General Public License
     6.1 --- a/scripting/dm_spawn_protection.sp	Mon Jun 25 23:43:20 2007 +0000
     6.2 +++ b/scripting/dm_spawn_protection.sp	Tue Jun 26 00:03:54 2007 +0000
     6.3 @@ -2,6 +2,7 @@
     6.4   * dm_spawn_protection.sp
     6.5   * Adds spawn protection to CS:S DM.
     6.6   * This file is part of CS:S DM, Copyright (C) 2005-2007 AlliedModders LLC
     6.7 + * by David "BAILOPAN" Anderson, http://www.bailopan.net/cssdm/
     6.8   *
     6.9   * This program is free software; you can redistribute it and/or
    6.10   * modify it under the terms of the GNU General Public License