summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64579b5)
raw | patch | inline | side by side (parent: 64579b5)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sat, 8 Feb 2020 23:45:27 +0000 (02:45 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Sat, 8 Feb 2020 23:45:27 +0000 (02:45 +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 3f285b4badce5fe4d574e455d8715f9333e35ec0..27ef5ecdb18b982c65cd625bb47e5ae86e356985 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
AddCommand('reconnect', GameCommands);
AddCommand('say', GameCommands);
AddCommand('tell', GameCommands);
+ AddCommand('centerprint', GameCommands);
AddCommand('overtime', GameCommands);
AddCommand('rcon_password', GameCommands);
AddCommand('rcon', GameCommands);
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 504171d4e52390b2bce42e5fbd34e78d473a3b40..23c09434500a78b91de1423888484296164d8a95 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
end else
g_Console_Add(_lc[I_MSG_SERVERONLY]);
end
+ else if cmd = 'centerprint' then
+ begin
+ if (Length(P) > 2) and (P[1] <> '') then
+ begin
+ chstr := '';
+ for a := 2 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('centerprint <timeout> <text>');
+ Exit;
+ end;
+
+ a := StrToIntDef(P[1], 100);
+ chstr := b_Text_Format(chstr);
+ g_Game_Message(chstr, a);
+ if g_Game_IsNet and g_Game_IsServer then
+ MH_SEND_GameEvent(NET_EV_BIGTEXT, a, chstr);
+ end
+ else g_Console_Add('centerprint <timeout> <text>');
+ end
else if (cmd = 'overtime') and not g_Game_IsClient then
begin
if (Length(P) = 1) or (StrToIntDef(P[1], -1) <= 0) then