Raised This Month: $51 Target: $400
 12% 

Need import colorchat module (text color) in this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 08-26-2015 , 11:55   Need import colorchat module (text color) in this plugin
Reply With Quote #1

Hi guys. Can anyone import colorchat in this demorecorder plugin?

I need green text in .sma file at this point:

PHP Code:
    g_DemoNamePrefix    register_cvar"amx_demo_prefix",    "[Demo]" ); 
Green - [Demo]

And this (in .txt file):

PHP Code:
[en]
RECORDINGIN We are now recording in your cstrike folder
RECORDINGAT 
Demo recording has been started at %
Green - %s

Thank you all!!
Attached Files
File Type: txt demorecorder.txt (1.7 KB, 134 views)
File Type: sma Get Plugin or Get Source (amx_demorecorder.sma - 580 views - 2.5 KB)

Last edited by LithuanianJack; 08-26-2015 at 11:56.
LithuanianJack is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-26-2015 , 12:01   Re: Need import colorchat module (text color) in this plugin
Reply With Quote #2

He you go:

PHP Code:
[en
RECORDINGIN We are now recording in your cstrike folder 
RECORDINGAT 
Demo recording has been started at ^4%
PHP Code:
/****************************************/
/*                    */
/*    Auto Demo Recorder        */
/*    by IzI                */
/*                    */
/****************************************/

#include <amxmodx>
#include <colorchat>
#pragma semicolon 1

new g_Toggleg_DModg_UseNIg_RStartAfterg_DemoNameg_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",    "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( 
get_pcvar_numg_Toggle ) ) {
        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 ) || get_pcvar_numg_Toggle ) != )
        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 );
    ColorChat(id, GREEN, "
[%s] ^1%^"%s.dem^"", szINamePrefix, LANG_PLAYER, "RECORDINGIN", szSName );
    ColorChat(id, GREEN, "
[%s] ^1%L", szINamePrefix, LANG_PLAYER, "RECORDINGAT", szTimedata );

Gh05t04 is offline
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 08-26-2015 , 16:56   Re: Need import colorchat module (text color) in this plugin
Reply With Quote #3

Quote:
Originally Posted by Gh05t04 View Post
He you go:

PHP Code:
[en
RECORDINGIN We are now recording in your cstrike folder 
RECORDINGAT 
Demo recording has been started at ^4%
PHP Code:
/****************************************/
/*                    */
/*    Auto Demo Recorder        */
/*    by IzI                */
/*                    */
/****************************************/

#include <amxmodx>
#include <colorchat>
#pragma semicolon 1

new g_Toggleg_DModg_UseNIg_RStartAfterg_DemoNameg_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",    "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( 
get_pcvar_numg_Toggle ) ) {
        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 ) || get_pcvar_numg_Toggle ) != )
        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 );
    ColorChat(id, GREEN, "
[%s] ^1%^"%s.dem^"", szINamePrefix, LANG_PLAYER, "RECORDINGIN", szSName );
    ColorChat(id, GREEN, "
[%s] ^1%L", szINamePrefix, LANG_PLAYER, "RECORDINGAT", szTimedata );

It doesn't work. Maybe i need colorchat module? I don't have it
LithuanianJack is offline
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 08-26-2015 , 17:07   Re: Need import colorchat module (text color) in this plugin
Reply With Quote #4

And errors when compiling:
Attached Thumbnails
Click image for larger version

Name:	asd1.png
Views:	57
Size:	18.0 KB
ID:	147741  
LithuanianJack is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode