diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 504171d4e52390b2bce42e5fbd34e78d473a3b40..0d31e221c6c5c0950e515552fe1b7ed26396620d 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
GAME_OPTION_BOTVSPLAYER = 32;
GAME_OPTION_BOTVSMONSTER = 64;
GAME_OPTION_DMKEYS = 128;
+ GAME_OPTION_RESPAWNITEMS = 256;
STATE_NONE = 0;
STATE_MENU = 1;
// Ñòàðòóåì ñåðâåð
if not g_Net_Host(IPAddr, Port, NetMaxClients) then
begin
- g_FatalError(_lc[I_NET_MSG] + _lc[I_NET_ERR_HOST]);
+ g_FatalError(_lc[I_NET_MSG] + Format(_lc[I_NET_ERR_HOST], [Port]));
Exit;
end;
g_Console_Add(_lc[I_MSG_DMKEYS_ON])
else
g_Console_Add(_lc[I_MSG_DMKEYS_OFF]);
- g_Console_Add(_lc[I_MSG_ONMAPCHANGE]);
+
+ if g_Game_IsNet then MH_SEND_GameSettings;
+ end;
+ end
+ else if (cmd = 'g_respawn_items') and not g_Game_IsClient then
+ begin
+ with gGameSettings do
+ begin
+ if (Length(P) > 1) and
+ ((P[1] = '1') or (P[1] = '0')) then
+ begin
+ if (P[1][1] = '1') then
+ Options := Options or GAME_OPTION_RESPAWNITEMS
+ else
+ Options := Options and (not GAME_OPTION_RESPAWNITEMS);
+ end;
+
+ if (LongBool(Options and GAME_OPTION_RESPAWNITEMS)) then
+ g_Console_Add(_lc[I_MSG_RESPAWNITEMS_ON])
+ else
+ g_Console_Add(_lc[I_MSG_RESPAWNITEMS_OFF]);
if g_Game_IsNet then MH_SEND_GameSettings;
end;
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