hello ,
PHP Code:
#include <amxmodx>
#include <nvault>
#include <time>
#define VERSION "0.0.1"
#define PLUGIN "Played Time"
#define MAX_PLAYERS 32
new g_iVault
new g_szSteamId[MAX_PLAYERS+1][32]
new g_iLastPlayedTime[MAX_PLAYERS+1]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
register_dictionary("time.txt")
g_iVault = nvault_open("played_time")
register_clcmd("say /playtime", "ClientCommand_PlayedTime")
}
public plugin_end()
{
nvault_close( g_iVault )
}
public client_authorized( id )
{
get_user_authid(id, g_szSteamId[id], charsmax(g_szSteamId[]))
new szTime[32]
nvault_get(g_iVault, g_szSteamId[id], szTime, charsmax(szTime))
g_iLastPlayedTime[id] = str_to_num(szTime)
}
get_user_total_playtime( id )
{
return g_iLastPlayedTime[id] + get_user_time(id)
}
public ClientCommand_PlayedTime( id )
{
new szTime[128]
get_time_length(id, get_user_total_playtime( id ), timeunit_seconds, szTime, charsmax(szTime))
client_print( id, print_chat, "Played time : %s", szTime )
}
public client_disconnect( id )
{
new szTime[32]
formatex(szTime, charsmax(szTime), "%d", get_user_total_playtime( id ))
nvault_set(g_iVault, g_szSteamId[id], szTime)
}
this plugin by ConnorMcLeod .
What I need to change here, that will show just hours? ( now its show hours, minutes, seconds)
thx.