|
@@ -7,14 +7,16 @@
|
|
|
|
|
|
#pragma newdecls required
|
|
|
|
|
|
-#define PLUGIN_VERSION "1.3.7"
|
|
|
+#include <stocksoup/color_literals>
|
|
|
+
|
|
|
+#define PLUGIN_VERSION "1.4.0"
|
|
|
|
|
|
public Plugin myinfo = {
|
|
|
name = "[TF2] Bot Manager",
|
|
|
author = "nosoop (forked from Dr. McKay)",
|
|
|
description = "Allows for customization of TFBots",
|
|
|
version = PLUGIN_VERSION,
|
|
|
- url = "http://csrd.science"
|
|
|
+ url = "http://csrd.science/"
|
|
|
};
|
|
|
|
|
|
ConVar cvarBotQuota;
|
|
@@ -42,6 +44,8 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
|
|
}
|
|
|
|
|
|
public void OnPluginStart() {
|
|
|
+ LoadTranslations("csrd_botmanager.phrases");
|
|
|
+
|
|
|
cvarBotQuota = CreateConVar("sm_bot_quota", "0", "Number of players to keep in the server");
|
|
|
cvarBotJoinAfterPlayer = CreateConVar("sm_bot_join_after_player", "1",
|
|
|
"If nonzero, bots wait until a player joins before entering the game.");
|
|
@@ -199,7 +203,8 @@ void AddBot() {
|
|
|
Call_PushCellRef(class);
|
|
|
Call_PushCellRef(team);
|
|
|
Call_PushCellRef(difficulty);
|
|
|
- Call_PushStringEx(name, sizeof(name), SM_PARAM_STRING_UTF8|SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
|
|
|
+ Call_PushStringEx(name, sizeof(name), SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY,
|
|
|
+ SM_PARAM_COPYBACK);
|
|
|
Call_Finish();
|
|
|
|
|
|
char strDifficulty[16], strTeam[16], strClass[16];
|
|
@@ -297,7 +302,11 @@ public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBr
|
|
|
|
|
|
if (IsFakeClient(client)) {
|
|
|
event.BroadcastDisabled = true;
|
|
|
- PrintToChatAll("\x01BOT \x07%06X%N \x01has left the game", GetTeamColor(GetClientTeam(client)), client);
|
|
|
+
|
|
|
+ char botDisplay[128];
|
|
|
+ Format(botDisplay, sizeof(botDisplay), "\x07%06X%N\x01",
|
|
|
+ GetTeamColor(GetClientTeam(client)), client);
|
|
|
+ PrintColoredChatAll("%t", "game_bot_player_left_game", botDisplay);
|
|
|
}
|
|
|
return Plugin_Continue;
|
|
|
}
|
|
@@ -314,8 +323,12 @@ public Action Event_PlayerTeam(Event event, const char[] name, bool dontBroadcas
|
|
|
joiningBots.Erase(pos);
|
|
|
|
|
|
PrintToServer("BOT %N has joined the game", client);
|
|
|
- PrintToChatAll("\x01BOT \x07%06X%N \x01has joined the game",
|
|
|
+
|
|
|
+ char botDisplay[128];
|
|
|
+ Format(botDisplay, sizeof(botDisplay), "\x07%06X%N\x01",
|
|
|
GetTeamColor(event.GetInt("team")), client);
|
|
|
+
|
|
|
+ PrintColoredChatAll("%t", "game_bot_player_joined_game", botDisplay);
|
|
|
}
|
|
|
}
|
|
|
return Plugin_Continue;
|