summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8065721)
raw | patch | inline | side by side (parent: 8065721)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Mon, 2 May 2022 13:44:59 +0000 (16:44 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Mon, 2 May 2022 13:44:59 +0000 (16:44 +0300) |
src/game/g_console.pas | patch | blob | history | |
src/game/g_game.pas | patch | blob | history |
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 87a1fba23b9c5120f144dd618f41080078dd80ad..983b63b195c285158b332ed9e99b910309aa55c5 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
AddCommand('bot_removeall', GameCommands);
AddCommand('chat', GameCommands);
AddCommand('teamchat', GameCommands);
+ AddCommand('announce', GameCommands);
AddCommand('game', GameCommands);
AddCommand('host', GameCommands);
AddCommand('map', GameCommands);
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 4ac5ec7ef8fd542e1b04f406e3637ad097fb5cb3..6049b9062b623b4ecbee540b685c17f6aca9e1c2 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
end else
g_Console_Add(_lc[I_MSG_GM_UNAVAIL]);
end
+ else if cmd = 'announce' then
+ begin
+ if g_Game_IsNet then
+ begin
+ if Length(P) > 1 then
+ begin
+ for a := 1 to High(P) do
+ chstr := chstr + P[a] + ' ';
+
+ if Length(chstr) > 200 then SetLength(chstr, 200);
+
+ if Length(chstr) < 1 then
+ begin
+ g_Console_Add('announce <text>');
+ Exit;
+ end;
+
+ chstr := 'centerprint 100 ' + b_Text_Format(chstr);
+ if g_Game_IsClient then
+ MC_SEND_RCONCommand(chstr)
+ else
+ g_Console_Process(chstr, True);
+ end
+ else
+ g_Console_Add('announce <text>');
+ end else
+ g_Console_Add(_lc[I_MSG_GM_UNAVAIL]);
+ end
else if cmd = 'game' then
begin
if gGameSettings.GameType <> GT_NONE then
name := e_CatPath(dir, Filename + '.png');
s := createDiskFile(name);
try
- e_MakeScreenshot(s, gWinSizeX, gWinSizeY);
+ e_MakeScreenshot(s, gWinSizeX, gWinSizeX);
s.Free;
g_Console_Add(Format(_lc[I_CONSOLE_SCREENSHOT], [name]))
except