AutoRecord POV por mapa
#1
Los que funcionan solo sobrescriben el archivo .dem, me sirviria que fuera por cada mapa =D
Responder
#2
https://amxmodx-es.com/Thread-pedido-gra...#pid188297

Responder
#3
(11/01/2021, 02:54 PM)Skylar escribió: https://amxmodx-es.com/Thread-pedido-gra...#pid188297

Gracias por responder el código compila, le puse debug y me aparece este mensaje

Código PHP:
[AMXXRun time error 4index out of bounds 
[AMXX]    [0autorecord.sma::grab_ar (line 50

Linea 50
Código PHP:
if(!equali(g_szServerIPg_MySQLTable[i][SERVER_IP])) 

Codigo
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_all
archivo127":""_" );
    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();
        }
    }


En la parte que dice { "PUBLICO", "ACÁ VA LA IP" }, puse la ip+puerto pero al compilar sale este mensaje

Código PHP:
warning 228lenght of initialler exceeds size of the enum field

error 
018: initialization data exceeds declared size 

Ya modifique esto, pero sigue el mismo mensaje.
Código PHP:
for(new 0sizeof(g_MySQLTable[])-1i++) 

El único detalle que veo es por la ip que excede por eso que no compila.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)