|
@@ -5,11 +5,11 @@
|
|
|
#include <tf2>
|
|
|
#include <tf2_stocks>
|
|
|
|
|
|
-#include <printvalvetranslation>
|
|
|
-
|
|
|
#pragma newdecls required
|
|
|
|
|
|
-#define PLUGIN_VERSION "1.3.8"
|
|
|
+#include <stocksoup/color_literals>
|
|
|
+
|
|
|
+#define PLUGIN_VERSION "1.4.0"
|
|
|
|
|
|
public Plugin myinfo = {
|
|
|
name = "[TF2] Bot Manager",
|
|
@@ -44,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.");
|
|
@@ -201,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];
|
|
@@ -303,8 +306,7 @@ public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBr
|
|
|
char botDisplay[128];
|
|
|
Format(botDisplay, sizeof(botDisplay), "\x07%06X%N\x01",
|
|
|
GetTeamColor(GetClientTeam(client)), client);
|
|
|
- PrintValveTranslationToAll(Destination_Chat, "game_player_left_game", botDisplay,
|
|
|
- "TF_Scoreboard_Bot");
|
|
|
+ PrintColoredChatAll("%t", "game_bot_player_left_game", botDisplay);
|
|
|
}
|
|
|
return Plugin_Continue;
|
|
|
}
|
|
@@ -320,13 +322,13 @@ public Action Event_PlayerTeam(Event event, const char[] name, bool dontBroadcas
|
|
|
if ((pos = joiningBots.FindValue(GetClientUserId(client))) != -1) {
|
|
|
joiningBots.Erase(pos);
|
|
|
|
|
|
- PrintToServer("%N (BOT) has joined the game", client);
|
|
|
+ PrintToServer("BOT %N has joined the game", client);
|
|
|
|
|
|
char botDisplay[128];
|
|
|
Format(botDisplay, sizeof(botDisplay), "\x07%06X%N\x01",
|
|
|
GetTeamColor(event.GetInt("team")), client);
|
|
|
|
|
|
- PrintValveTranslationToAll(Destination_Chat, "game_player_joined_game", botDisplay);
|
|
|
+ PrintColoredChatAll("%t", "game_bot_player_joined_game", botDisplay);
|
|
|
}
|
|
|
}
|
|
|
return Plugin_Continue;
|