Skip to content

Commit

Permalink
Fixed strftime
Browse files Browse the repository at this point in the history
Fixed strftime
  • Loading branch information
SmileYzn authored Feb 14, 2025
1 parent 687db2e commit 8810fde
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions MatchBot/MatchBot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,21 +1225,22 @@ void CMatchBot::RecordDemo(edict_t *pEntity)
// If is enabled
if (this->m_AutoDemoRecord->value > 0.0f)
{
struct tm* tm_info = localtime(NULL);

if (tm_info)
if (!FNullEnt(pEntity))
{
char Date[32] = { 0 };

strftime(Date, sizeof(Date), "%F-%H-%M-%S", tm_info);

char Name[64] = { 0 };

Q_sprintf(Name, "match-%s", Date);

gMatchUtil.ClientCommand(pEntity, "stop; record \"%s\";", Name);
time_t Temp = time(NULL);

struct tm *tm_info = localtime(&Temp);

gMatchUtil.SayText(pEntity, PRINT_TEAM_DEFAULT, _T("Recording demo to ^3%s.dem^1 in your client."), Name);
if (tm_info)
{
char DateTime[32] = { 0 };

strftime(DateTime, sizeof(DateTime), "%F-%H-%M-%S", tm_info);

gMatchUtil.ClientCommand(pEntity, "stop; record \"mb-%s\";", DateTime);

gMatchUtil.SayText(pEntity, PRINT_TEAM_DEFAULT, _T("Recording demo to ^3mb-%s.dem^1 in your client."), DateTime);
}
}
}
}
Expand Down

3 comments on commit 8810fde

@lambdabest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server is no longer down but the demo has not yet started recording.

@lambdabest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta list
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Match Bot RUN - matchbot_mm.so v1.0.5 ini Start ANY
[ 2] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 3] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5294 ini Start ANY
[ 4] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl3 ANY ANY
[ 5] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl3 ANY ANY
5 plugins, 5 running
amxx plugins
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0.5294 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 3] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 4] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 5] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 6] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 7] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 8] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 9] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 10] CVAR Checker 1.0.1 EKS cvar_checker.am debug
[ 11] Fire in the hole 4.0 novak fire_in_the_hol running
[ 12] unknown unknown unknown gameguard.amxx debug
[ 13] HPP_BLOCK 1.2 Karaulov hpp_hack_block. running
13 plugins, 13 running
mb_auto_demo_record
"mb_auto_demo_record" is "1"

@lambdabest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MATCH] LAMBDAK47_- comienza la partida.
[MATCH] Deathmatch deshabilitado.
[MATCH] Comenzando Ronda de Cuchillos, Prepárate!
[MATCH] Live en tres restarts! Prepárate!!
Escribe 'amx_langmenu' en la consola para mostrar un menu en el cual puedes elegir tu idioma
[MATCH] La Partida Ha Comenzado! Good Luck & Have Fun!!

  • Ronda 1 ganada por: Antiterroristas
    �LAMBDAK47_- is joining the Terrorist force (auto)
    [MATCH] Marcador está empatado: 0-0
    "sv_restart" changed to "3"
    [MATCH] Antiterroristas ha ganado la Ronda de Cuchillos, elección de equipos iniciada.
    The game will restart in 3 SECONDS
    "sv_restart" changed to "0"
    [MATCH] Ninguna estadística en esta ronda.
    "sv_restart" changed to "2"
    The game will restart in 2 SECONDS
    "sv_restart" changed to "0"
    "sv_restart" changed to "1"
    The game will restart in 1 SECOND
    "sv_restart" changed to "0"
    [MATCH] LAMBDAK47_- eligió a Terroristas
    [MATCH] Cambiando de equipos ahora.
    [MATCH] Comenzando Primera Parte, Prepárate!
    [MATCH] Live en tres restarts! Prepárate!!
    [MATCH] La Partida Ha Comenzado! Good Luck & Have Fun!!
    [MATCH] Marcador está empatado: 0-0
    ] stop
    Not recording a demo.

Please sign in to comment.