![]()
| 
					 | 
				
					Quellcode | 
			
					1 2 3 4 5 6 7 8 9 10 11 12 13 14  | 
				
					// BOTS // // Add a bot to the Consortium team bot_add_ct 3 // Add a bot to the Empire team bot_add_emp 3 // Number of bots bot_quota 6 // [ normal | fill | match ] = If fill, the server will adjust bots to keep N players in the game, where N is bot_quota. // If 'match', the server will maintain a 1:N ratio of humans to bots. If normal there will be N bots in the game. Where N is bot_quota. bot_quota_mode fill  | 
			
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »R A N T A N P L A N« (7. Januar 2012, 22:34)
| 
					 | 
				
					Quellcode | 
			
					1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48  | 
				
					#include <sourcemod>
#define PLUGIN_VERSION "1.0.0"
public Plugin:myinfo = 
{
	name = "Bot Quota Kick",
	author = "MadMakz",
	description = "Destroy Bots not respecting the Quota",
	version = PLUGIN_VERSION,
	url = "http://cgx24.com"
};
new Handle:cBotQuota;
new sBotQuota;
public OnPluginStart()
{
	CreateConVar("bqk_version", PLUGIN_VERSION, "Destroy Bots not respecting the Quota", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
	cBotQuota = FindConVar("bot_quota");
	
	
}
public OnClientPostAdminCheck()
{	
	if (cBotQuota != INVALID_HANDLE)
	{
		sBotQuota = GetConVarInt(cBotQuota);
		if (GetRealClientCount() >= sBotQuota)
		{
			ServerCommand("bot_kick");
		}
	}
}
stock GetRealClientCount(bool:inGameOnly = true)
{
	new clients = 0;
	for(new i = 1; i <= GetMaxClients(); i++)
	{
		if (((inGameOnly) ? IsClientInGame(i) : IsClientConnected(i)) && !IsFakeClient(i))
		{
			clients++;
		}
	}
	return clients;
}
				 | 
			
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »MadMakz« (8. Januar 2012, 06:22)
Warnung: Reiner Besserwisserpost
@RANTANPLAN
Wieso machst du bot_add_x, bot_quota fügt diese automatisch hinzu, zumindest bei CSS.
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »MadMakz« (8. Januar 2012, 19:07)