Raised This Month: $32 Target: $400
 8% 

Played time HUD


Post New Thread Reply   
 
Thread Tools Display Modes
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
Old 09-05-2013, 11:41
raducuursu
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
3xit.
Junior Member
Join Date: Nov 2012
Old 09-17-2013 , 08:58   Re: Played time HUD
Reply With Quote #3

I don't understand what your trying to do?

You added HUD messages in the other... Add this in getPlayTime(id)

PHP Code:
set_dhudmessage100202500.130.7026.08.0 ) [/COLOR]
show_dhudmessageid"Your accumulated time is: %s"output); 

Last edited by 3xit.; 09-17-2013 at 08:59.
3xit. is offline
Alider
Member
Join Date: Nov 2013
Location: Romania , Bucuresti
Old 11-14-2013 , 05:32   Re: Played time HUD
Reply With Quote #4

commas??? yo don't have commas.inc ?
Alider is offline
Send a message via Yahoo to Alider
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 21:31.


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