Jump to content
Sign in to follow this  
kundzbergs

demorec help

Recommended Posts

Tātad gribētu zināt ko no pašreizējām darbībām esmu izdarījis nepareizi, nomainīt visu nomainīju, demo ierakstās, bet vienalga priekšpusē rāda šo un nerāda nosaukumu kuru nomainīju. 

Patreiz rāda šādi: [[AMXX]] Demo ierakstas Tava cstrike mape "TAVS_DEMO_NOSAUKUMS.dem"
[[AMXX]] Demo saka ierakstities 16:54:15

 

#include <amxmodx>
#pragma semicolon 1

new g_Toggle, g_DMod, g_UseNI, g_RStartAfter, g_DemoName, g_DemoNamePrefix;

public plugin_init() { 
    register_plugin( "Auto Demo Recorder", "1.5", "IzI" );
    g_Toggle         = register_cvar( "amx_demo",        "1" );
    g_DMod            = register_cvar( "amx_demo_mode",    "0" );
    g_UseNI         = register_cvar( "amx_demo_steamid",    "0" );
    g_RStartAfter         = register_cvar( "amx_demo_rectime",    "25" );    // Ja mazak par 5, tad tas automatiski uzlikts 5 min. Es ieteiktu likt mapes laiku, ka demo ierakstisanas laiku
    g_DemoName         = register_cvar( "amx_demo_name",    "DD2_DUST_DEM" );
    g_DemoNamePrefix    = register_cvar( "amx_demo_prefix",    "[dust.lv]" );
    register_dictionary( "demorec.txt" );
}

public client_putinserver( id ) {
    if( get_pcvar_num( g_Toggle ) ) {
        new Float:delay = get_pcvar_float( g_RStartAfter );
        if( delay < 5 )
            set_pcvar_float( g_RStartAfter, ( delay = 5.0 ) );
        set_task( delay, "Record", id );
    }
}

public Record( id ) {
    if( !is_user_connected( id ) || get_pcvar_num( g_Toggle ) != 1 )
        return;

    // Getting time, client SteamID, server's name, server's ip with port.
    new szSName[128], szINamePrefix[64], szTimedata[9];
    new iUseIN = get_pcvar_num( g_UseNI );
    new iDMod = get_pcvar_num( g_DMod );
    get_pcvar_string( g_DemoNamePrefix, szINamePrefix, 63 );
    get_time ( "%H:%M:%S", szTimedata, 8 );

    switch( iDMod ) {
        case 0: get_pcvar_string( g_DemoName, szSName, 127 );
        case 1: get_user_ip( 0, szSName, 127, 0 );
        case 2: get_user_name( 0, szSName, 127 );
    }

    if( iUseIN ) {
        new szCID[32];
        get_user_authid( id, szCID, 31 );
        format( szSName, 127, "[%s]%s", szCID, szSName );
    }

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

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

 

Edited by kundzbergs

Share this post


Link to post
Share on other sites
59 minutes ago, Chill it BanG said:

Kas tev demorec.txt failā sadrukāts?

Un vai kādā cfg failā (most likely amxx.cfg) nav sadefinētas vērtības priekš amx_demo_name un amx_demo_prefix?

Viss aizgāja.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.