Raised This Month: $ Target: $400
 0% 

client_print add player nick & ip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-ynk
Junior Member
Join Date: Jun 2009
Old 10-07-2009 , 10:56   client_print add player nick & ip
Reply With Quote #1

Hi there ;)
I have auto pov demo plugin, but this plugin are not showing player nickname and ip adress...

Code:
/****************************************/
/*                    */
/*    Auto Demo Recorder        */
/*    by IzI                */
/*                    */
/****************************************/

#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",    "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",    "CHILL-Public" );
    g_DemoNamePrefix    = register_cvar( "amx_demo_prefix",    "POV DEMO" );
    register_dictionary( "demorecorder.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, "[POV DEMO] Recording has started... ");
    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 );
    client_print( id, print_chat, "Here i need player nick and ip");
}
client_print( id, print_chat, "Here i need player nick and ip");

Can somebody help with a little bit edit ?

Last edited by -ynk; 10-07-2009 at 10:59.
-ynk is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 10-07-2009 , 11:16   Re: client_print add player nick & ip
Reply With Quote #2

PHP Code:
/****************************************/
/*                    */
/*    Auto Demo Recorder        */
/*    by IzI                */
/*                    */
/****************************************/

#include <amxmodx>
#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",    "CHILL-Public" );
    
g_DemoNamePrefix    register_cvar"amx_demo_prefix",    "POV DEMO" );
    
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 );
    client_print( id, print_chat, "
[POV DEMORecording has started... ");
    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 );

    new name[33],ip[17]
    get_user_name(id,name,32)
    get_user_ip(id,ip,16,1)
    client_print( id, print_chat, "
Playernick:%s,IP:%s",name,ip);

__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
-ynk
Junior Member
Join Date: Jun 2009
Old 10-08-2009 , 08:21   Re: client_print add player nick & ip
Reply With Quote #3

Thanks man

Can you add some lines for server hostname olso ?


I think this line:
PHP Code:
client_printidprint_center"Recording has started..."); 
will be usefull if there will be printing out server hostname.
-ynk is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 10-08-2009 , 12:20   Re: client_print add player nick & ip
Reply With Quote #4

PHP Code:
    // Displaying messages.
    
client_cmdid"stop; record ^"%s^""szSName );

    new 
szHostname[128]
    
get_cvar_string("hostname",szHostname,127)
    
client_printidprint_chat"[POV DEMO] Hostname:%s",szHostname);
    
client_printidprint_chat"[%s] %L ^"%s.dem^""szINamePrefixLANG_PLAYER"RECORDINGIN"szSName );
    
client_printidprint_chat"[%s] %L"szINamePrefixLANG_PLAYER"RECORDINGAT"szTimedata );

    new 
name[33],ip[17]
    
get_user_name(id,name,32)
    
get_user_ip(id,ip,16,1)
    
client_printidprint_chat"Playernick:%s,IP:%s",name,ip); 
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 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 22:42.


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