HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2.  
  3. #define PLUGIN_NEV "Bot kirúgó"
  4. #define PLUGIN_LERIAS "Bot kirúgó"
  5. #define PLUGIN_AUTHOR "Nexd"
  6. #define PLUGIN_VERSION "1.0"
  7. #define PLUGIN_URL "steelclouds.clans.hu"
  8.  
  9. public Plugin myinfo =
  10. {
  11. name = PLUGIN_NEV,
  12. author = PLUGIN_AUTHOR,
  13. description = PLUGIN_LERIAS,
  14. version = PLUGIN_VERSION,
  15. url = PLUGIN_URL
  16. };
  17.  
  18. ConVar g_Cvar_bot_quota = null;
  19. int g_bot_quota;
  20. int g_max_players;
  21.  
  22. public OnConfigsExecuted()
  23. {
  24. g_Cvar_bot_quota = FindConVar("bot_quota");
  25.  
  26. g_bot_quota = GetConVarInt(g_Cvar_bot_quota);
  27. g_max_players = GetMaxClients();
  28. }
  29.  
  30. public OnClientPutInServer(client)
  31. {
  32. if(!IsFakeClient(client))
  33. return;
  34.  
  35. if(g_bot_quota < GetConVarInt(g_Cvar_bot_quota))
  36. SetConVarInt(g_Cvar_bot_quota, g_bot_quota);
  37.  
  38. int i, count;
  39. for(i = 1; i<=g_max_players; i++)
  40. if(IsClientInGame(i) && GetClientTeam(i)>1)
  41. count++;
  42.  
  43. if(count<=g_bot_quota)
  44. return;
  45.  
  46. char name[32]
  47. if(!GetClientName(client, name, 31))
  48. return;
  49. ServerCommand("bot_kick %s", name);
  50. }