AUTODEMO SOLO PARA ADMINS
#1
Hola buenas noches, quisiera que me ayudaran con el plugin del autodemo recorder, me gustaria que solo funcione para los admins, osea que solo a los admins se les guarden las demos osea que solo a ellos se le permita autograbar. muchas gracias espero que puedan ayudarme
Responder
#2
(11/06/2018, 02:38 AM)Arnaldo21 escribió: Hola buenas noches, quisiera que me ayudaran con el plugin del autodemo recorder, me gustaria que solo funcione para los admins, osea que solo a los admins se les guarden las demos osea que solo a ellos se le permita autograbar. muchas gracias espero que puedan ayudarme

Deja el código adjunto.
Responder
#3
Código PHP:
/****************************************/
/*                    */
/*    Auto Demo Recorder        */
/*    by IzI                */
/*                    */
/****************************************/

#include <amxmodx>
#pragma semicolon 1

new g_DModg_UseNIg_RStartAfterg_DemoNameg_DemoNamePrefix;

public 
plugin_init() { 
    
register_plugin"Auto Demo Recorder""1.5""IzI" );
    
g_DMod            register_cvar"amx_demo_mode",    "0" );
    
g_UseNI         register_cvar"amx_demo_steamid",    "0" );
    
g_RStartAfter         register_cvar"amx_demo_rectime",    "15" );    // If it is less than 5, it will automatically set to 5, but willn't apply the changes to the console. I recoment to use default settings.
    
g_DemoName         register_cvar"amx_demo_name",    "Autorecorded demo" );
    
g_DemoNamePrefix    register_cvar"amx_demo_prefix",    "AMXX" );
    
register_dictionary"demorecorder.txt" );
}

public 
client_putinserverid ) {
    if( 
is_user_adminid ) ) {
        new 
Float:delay get_pcvar_floatg_RStartAfter );
        if( 
delay )
            
set_pcvar_floatg_RStartAfter, ( delay 5.0 ) );
        
set_taskdelay"Record"id );
    }
}

public 
Recordid ) {
    if( !
is_user_connectedid ) )
        return;

    
// Getting time, client SteamID, server's name, server's ip with port.
    
new szSName[128], szINamePrefix[64], szTimedata[9];
    new 
iUseIN get_pcvar_numg_UseNI );
    new 
iDMod get_pcvar_numg_DMod );
    
get_pcvar_stringg_DemoNamePrefixszINamePrefix63 );
    
get_time "%H:%M:%S"szTimedata);

    switch( 
iDMod ) {
        case 
0get_pcvar_stringg_DemoNameszSName127 );
        case 
1get_user_ip0szSName127);
        case 
2get_user_name0szSName127 );
    }

    if( 
iUseIN ) {
        new 
szCID[32];
        
get_user_authididszCID31 );
        
formatszSName127"[%s]%s"szCIDszSName );
    }

    
// Replacing signs.
    
replace_allszSName127":""_" );
    
replace_allszSName127".""_" );
    
replace_allszSName127"*""_" );
    
replace_allszSName127"/""_" );
    
replace_allszSName127"|""_" );
    
replace_allszSName127"\", "_" );
    replace_all( szSName, 127, "
?", "_" );
    replace_all( szSName, 127, "
>", "_" );
    replace_all( szSName, 127, "
<", "_" );
    replace_all( szSName, 127, " ", "
_" );

    // Displaying messages.
    client_cmd( id, "
stoprecord ^"%s^"", szSName );
    client_print( id, print_chat, "
[%s] %^"%s.dem^"", szINamePrefix, LANG_PLAYER, "RECORDINGIN", szSName );
    client_print( id, print_chat, "
[%s] %L", szINamePrefix, LANG_PLAYER, "RECORDINGAT", szTimedata );
}

stock is_user_admin(id)
{
    new __flags = get_user_flags(id);
    return (__flags > 0 && !(__flags & ADMIN_USER));

(13/08/2018, 07:59 PM)KrR10VnZl escribió: Usted tiene un retraso de otro mundo, pon de tu parte coño, como es posible que preguntes cual código? muchacho mongólico si dice código, él se refiere al SMA del CTF, dios mio y si no te gusta que te digan que tienes un retraso magistral, astral del otro mundo pon de tú parte y no hagas preguntas tontas.
Responder
#4
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


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)