pedido grabar demo automaticamente
#1
buenas alguien me puede hacer un plugin que grabe demos automaticamente es para mi servidor pug y cuando grabe la demo este en el nombre ponga el nombre del mapa y ponga cuando se juega del lado ct y tt
La vida solo es una a si que ha disfrutarla y no desperdiciarla...
Responder
#2
Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"AUTOMIX""1xx.x.1xx.xx8:xxxx5" }, 
    { 
"AUTOMIX""IP" }, 
    { 
"TTT""ACA VA LA IP" }, 
    { 
"Hunger_Games""IP" }, 
    { 
"PUBLICO""ACA VA LA IP" }, 
    { 
"PCW_Mix""IP" 
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{
    if(
is_user_admin(id))
        
set_task(10.0"grab_ar"id)

 }

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record Admin^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!y** Estamos grabando una demo para !gADMIN !")
    CC(id, "
!y** Archivo:!^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }

Responder
#3
(15/09/2018, 12:29 PM)Chema escribió:
Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"AUTOMIX""1xx.x.1xx.xx8:xxxx5" }, 
    { 
"AUTOMIX""IP" }, 
    { 
"TTT""ACA VA LA IP" }, 
    { 
"Hunger_Games""IP" }, 
    { 
"PUBLICO""ACA VA LA IP" }, 
    { 
"PCW_Mix""IP" 
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{
    if(
is_user_admin(id))
        
set_task(10.0"grab_ar"id)

 }

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record Admin^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!y** Estamos grabando una demo para !gADMIN !")
    CC(id, "
!y** Archivo:!^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }


ese es para que grabe solo para admin, yo quiero q les grabe a todos por general como si fueran a poner récord nombre pero q el plugin lo haga automáticamente y diga el mapa que esta jugando y que cuando sea ct diga en el nombre ct y cuando cambie de lado diga empieze otra demo y esta vez diga tt
La vida solo es una a si que ha disfrutarla y no desperdiciarla...
Responder
#4
Esto podria ser:

https://forums.alliedmods.net/showthread.php?p=770786
Responder
#5
(15/09/2018, 12:33 PM)kikiN escribió:
(15/09/2018, 12:29 PM)Chema escribió:
Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"AUTOMIX""1xx.x.1xx.xx8:xxxx5" }, 
    { 
"AUTOMIX""IP" }, 
    { 
"TTT""ACA VA LA IP" }, 
    { 
"Hunger_Games""IP" }, 
    { 
"PUBLICO""ACA VA LA IP" }, 
    { 
"PCW_Mix""IP" 
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{
    if(
is_user_admin(id))
        
set_task(10.0"grab_ar"id)

 }

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record Admin^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!y** Estamos grabando una demo para !gADMIN !")
    CC(id, "
!y** Archivo:!^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }


ese es para que grabe solo para admin, yo quiero q les grabe a todos por general como si fueran a poner récord nombre pero q el plugin lo haga automáticamente y diga el mapa que esta jugando y que cuando sea ct diga en el nombre ct y cuando cambie de lado diga empieze otra demo y esta vez diga tt

Cambia:
Código PHP:
public client_putinserver(id)
{
    if(
is_user_admin(id))
        
set_task(10.0"grab_ar"id)

 } 
Por:
Código PHP:
public client_putinserver(id)
    
set_task(10.0"grab_ar"id

Responder
#6
Tenés que stopear después también la demo en client_disconnect xD.
Responder
#7
(15/09/2018, 02:33 PM)Niper.-. escribió: Tenés que stopear después también la demo en client_disconnect xD.

Se stopea sola... de igual forma podes hacerlo sin problemas

PD: te conviene que solo le grabe a admins, imaginate que vas a tener players que les resulte tedioso que les grabe siempre demos y tal vez ni entren (opinion mia)
Responder
#8
(15/09/2018, 03:23 PM)matrix123 escribió:
(15/09/2018, 02:33 PM)Niper.-. escribió: Tenés que stopear después también la demo en client_disconnect xD.

Se stopea sola... de igual forma podes hacerlo sin problemas

PD: te conviene que solo le grabe a admins, imaginate que vas a tener players que les resulte tedioso que les grabe siempre demos y tal vez ni entren (opinion mia)

mi opinion mia seria que grabe demo a todos a si si alguein quiere ver sus jugadas o quiera ver si alguien la chiteaba o cosas a si para mi seria buena idea aunq si va hacer tedioso q cada mapa te grabe demo y se van acumulando pero para mi seria bueno, una pregunta como puedo hacer que la grabacion de la demo inicie cuando el pug se inicie y este finalize cuando el pug se finalize

(15/09/2018, 02:10 PM)Skylar escribió:
(15/09/2018, 12:33 PM)kikiN escribió:
(15/09/2018, 12:29 PM)Chema escribió:
Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"AUTOMIX""1xx.x.1xx.xx8:xxxx5" }, 
    { 
"AUTOMIX""IP" }, 
    { 
"TTT""ACA VA LA IP" }, 
    { 
"Hunger_Games""IP" }, 
    { 
"PUBLICO""ACA VA LA IP" }, 
    { 
"PCW_Mix""IP" 
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{
    if(
is_user_admin(id))
        
set_task(10.0"grab_ar"id)

 }

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record Admin^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!y** Estamos grabando una demo para !gADMIN !")
    CC(id, "
!y** Archivo:!^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }


ese es para que grabe solo para admin, yo quiero q les grabe a todos por general como si fueran a poner récord nombre pero q el plugin lo haga automáticamente y diga el mapa que esta jugando y que cuando sea ct diga en el nombre ct y cuando cambie de lado diga empieze otra demo y esta vez diga tt

Cambia:
Código PHP:
public client_putinserver(id)
{
    if(
is_user_admin(id))
        
set_task(10.0"grab_ar"id)

 } 
Por:
Código PHP:
public client_putinserver(id)
    
set_task(10.0"grab_ar"id

me salen estos logs y no funciona el plugin
L 09/15/2018 - 19:09:31: [AMXX] Displaying debug trace (plugin "amx_demorecorder.amxx", version "v0.1.1")

L 09/15/2018 - 19:09:31: [AMXX] Run time error 4: index out of bounds

L 09/15/2018 - 19:09:31: [AMXX] [0] amx_demorecorder.sma::grab_ar (line 50)

Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"Pug""xxx.xxxx.xx:xxxx" }, 
    { 
"AUTOMIX""IP" }, 
    { 
"TTT""ACA VA LA IP" }, 
    { 
"Hunger_Games""IP" }, 
    { 
"PUBLICO""ACA VA LA IP" }, 
    { 
"PCW_Mix""IP" 
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{
if(
is_user_connected(id))
set_task(10.0"grab_ar"id)

}

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!yEmpezaremos a grabar la !gdemo !yal iniciar el pug")
    CC(id, "
!yArchivo:!g^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }

La vida solo es una a si que ha disfrutarla y no desperdiciarla...
Responder
#9
Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"Pug""xxx.xxxx.xx:xxxx" }, 
    { 
"AUTOMIX""IP" }, 
    { 
"TTT""ACA VA LA IP" }, 
    { 
"Hunger_Games""IP" }, 
    { 
"PUBLICO""ACA VA LA IP" }, 
    { 
"PCW_Mix""IP" 
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{

    
set_task(10.0"grab_ar"id)

}

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!yEmpezaremos a grabar la !gdemo !yal iniciar el pug")
    CC(id, "
!yArchivo:!g^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }

Responder
#10
(15/09/2018, 04:40 PM)matrix123 escribió:
Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"Pug""xxx.xxxx.xx:xxxx" }, 
    { 
"AUTOMIX""IP" }, 
    { 
"TTT""ACA VA LA IP" }, 
    { 
"Hunger_Games""IP" }, 
    { 
"PUBLICO""ACA VA LA IP" }, 
    { 
"PCW_Mix""IP" 
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{

    
set_task(10.0"grab_ar"id)

}

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!yEmpezaremos a grabar la !gdemo !yal iniciar el pug")
    CC(id, "
!yArchivo:!g^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }


ahora me sale este logs
L 09/15/2018 - 20:14:12: [AMXX] Displaying debug trace (plugin "amx_demorecorder.amxx", version "v0.1.1")

L 09/15/2018 - 20:14:12: [AMXX] Run time error 4: index out of bounds

L 09/15/2018 - 20:14:12: [AMXX] [0] amx_demorecorder.sma::grab_ar (line 45)

Código PHP:
if(!equali(g_szServerIPg_MySQLTable[i][SERVER_IP])) 
La vida solo es una a si que ha disfrutarla y no desperdiciarla...
Responder
#11
ayuda me salen estos logs en el servidor
L 09/16/2018 - 01:29:47: [AMXX] Displaying debug trace (plugin "amx_demorecorder.amxx", version "v0.1.1")

L 09/16/2018 - 01:29:47: [AMXX] Run time error 4: index out of bounds

L 09/16/2018 - 01:29:47: [AMXX] [0] amx_demorecorder.sma::grab_ar (line 45)

la linea 45 es esta
Código PHP:
if(!equali(g_szServerIPg_MySQLTable[i][SERVER_IP])) 

Código PHP:
#include <amxmodx>
#include <amxmisc>

new g_mapname[32];

enum _DATA_SERVER SERVER_TABLE[20], SERVER_IP[21] };

new const 
g_MySQLTable[][_DATA_SERVER] = 
{
    { 
"Pug""140.82.31.37:27018" }
};

new 
g_szServerIP[21];

public 
plugin_init()
{
    
register_plugin("Demo Record Admin""v0.1.1""matrix123");

    
get_mapname(g_mapnamecharsmax(g_mapname));

    
get_user_ip(0g_szServerIPcharsmax(g_szServerIP), 0);
}

public 
client_putinserver(id)
{

    
set_task(10.0"grab_ar"id)

}

public 
plugin_cfg()
{
    
server_cmd("amx_pausecfg add ^"Demo Record^"");
}
public 
grab_arid )
{
    if(!
is_user_connected(id))
        return;

    new 
archivo[150], szTimedata[9];
    
get_time "%D/%m/%Y"szTimedata);

    for(new 
0sizeof(g_MySQLTable[]); i++)
    {
        if(!
equali(g_szServerIPg_MySQLTable[i][SERVER_IP]))
            continue;

        
format(archivocharsmax(archivo), "%s_DEM_%s_%s"g_MySQLTable[i][SERVER_TABLE], szTimedatag_mapname)
    }    

    
replace_allarchivo127":""_" );
    
replace_allarchivo127".""_" );
    
replace_allarchivo127"*""_" );
    
replace_allarchivo127"/""_" );
    
replace_allarchivo127"|""_" );
    
replace_allarchivo127"\", "_" );
    replace_all( archivo, 127, "
?", "_" );
    replace_all( archivo, 127, "
>", "_" );
    replace_all( archivo, 127, "
<", "_" );
    replace_all( archivo, 127, " ", "
_" );


    CC(id, "
!yEmpezaremos a grabar la !gdemo !yal iniciar el pug")
    CC(id, "
!yArchivo:!g^"%s.dem^"", archivo);

    client_cmd(id, "
stoprecord ^"%s^"", archivo);
    return;
 } 

 stock CC(const Index, const input[], any:...)
{
    static i_Count; i_Count = 1;
    static sz_Players[32];
    static sz_Msg[191];
    
    new g_messageid_saytext;
    g_messageid_saytext = get_user_msgid("
SayText");

    vformat(sz_Msg, charsmax(sz_Msg), input, 3);
    
    replace_all(sz_Msg, charsmax(sz_Msg), "
!y" , "^1");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!t" , "^3");
    replace_all(sz_Msg, charsmax(sz_Msg), "
!g" , "^4");
    
    if(Index) sz_Players[0] = Index;
    else get_players(sz_Players, i_Count, "
ch");
    
    for(new i = 0; i < i_Count; i++)
    {
        if(is_user_connected(sz_Players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_messageid_saytext, _, sz_Players[i]);
            write_byte(sz_Players[i]);
            write_string(sz_Msg);
            message_end();
        }
    }

La vida solo es una a si que ha disfrutarla y no desperdiciarla...
Responder
#12
Lo que es no tener la suficiente inteligencia para buscar por tu cuenta e intentar hacer tus propios codigos, es mas facil hacer 10 temas al dia pidiendo que te armen tu servidor. Oh god why

Código PHP:
for(new 0sizeof(g_MySQLTable[]); i++)

-->

for(new 
0sizeof(g_MySQLTable[])-1i++) 
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#13
No se nada de códigos, a juro edito, y me queda bien, pero diganme cual de todos es el "BUENO" Para añadirlo a mi server, pero mi pregunta es (SE LES GUARDA A ELLOS, O EN EL SERVIDOR)? [cstrike/delserver]¿? Aiuda
Responder
#14
(17/09/2018, 09:52 PM)jevs31072001 escribió: No se nada de códigos, a juro edito, y me queda bien, pero diganme cual de todos es el "BUENO" Para añadirlo a mi server, pero mi pregunta es (SE LES GUARDA A ELLOS, O EN EL SERVIDOR)? [cstrike/delserver]¿? Aiuda

Se le guarda al usuario y arriba dejaron la solución al plugin.

Responder
#15
Corazón 
Gracias :'v
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)