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

Played time HUD


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
raducuursu
Junior Member
Join Date: Sep 2012
Old 09-05-2013 , 10:54   Played time HUD
Reply With Quote #1

Somebody help me get in HUD Played time

I already included plugin put time played after (Welcome,% s ^ NWE hope you `ll enjoy you stay here! ^ n ^ n% s ^ n% s ^ nYou rank is from% s ^ n ^ nTime Played ;

PHP Code:
#include < amxmodx > 
#include < csstats >
#include < dhudmessage >
#include <Commas>
#include <nvault>
#include <time>

#define PLUGIN_VERSION    "1.0.0"

new gHostName;
new 
output[64], key[33][32], vault;


public 
plugin_init( )
{
    
register_plugin"Connect Info Hud""1.0.1""4fun" );
    
    
gHostName get_cvar_pointer"hostname" );
    
register_clcmd("say /h""getPlayTime");
    
register_dictionary("time.txt");
    
vault nvault_open("playtimes");
    if (
vault == INVALID_HANDLE)
        
set_fail_state("Error opening nVault");
}

public 
client_putinserverid )
{
    if( 
is_user_botid ) ) 
        return;
        
    
set_task13.0"go_info"id );
    
set_task24.0"fav"id )
}

public 
go_infoid )
{
    new 
s_HostName64 ];
    
get_pcvar_stringgHostNames_HostNamecharsmaxs_HostName ) );
    
    static 
s_Name 32 ];
    
get_user_nameids_Namecharsmax s_Name ) );

        static 
stats], body];
    new 
s_RankPos get_user_stats idstatsbody );
    new 
s_MaxRank get_statsnum ( );
    
        static 
rankposString[16], maxrankString[16];
        
AddCommas(s_RankPosrankposString15);
        
AddCommas(s_MaxRankmaxrankString15);

        
set_dhudmessage20255200.100.2426.08.0 );
    
show_dhudmessageid"Welcome, %s^nWe hope you enjoy you`ll stay here!^n^n%s^n^nYou rank is %s from %s"s_Names_HostNamerankposStringmaxrankString );
}

public 
fav(id)
{
    new 
s_HostName64 ];
    
get_pcvar_stringgHostNames_HostNamecharsmaxs_HostName ) );

        
set_dhudmessage100202500.130.7026.08.0 )
        
show_dhudmessageid"%s^nDon't forget to add us to your favourites."s_HostName )
}

public 
getPlayTime(id) {
    
get_time_length(id, (get_user_time(id) + nvault_get(vaultkey[id])), timeunit_seconds output63);
    
client_print(idprint_chat"Your accumulated time is: %s"output);
}

public 
client_authorized(id) {
    
get_user_authid(idkey[id], 31);
    
nvault_touch(vaultkey[id]);
}

public 
client_disconnect(id) {
    new 
value[33], timestamp;
    
nvault_lookup(vaultkey[id], value32timestamp);
    
formatex(value32"%d", ((time() - timestamp) + nvault_get(vaultkey[id])));
    
nvault_set(vaultkey[id], value);
}

public 
plugin_end() {
    
nvault_close(vault);

raducuursu is offline
 



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 16:29.


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