Hello i have good idea i think. I need plugin to my server like:
Plugin has 3 modes: day, week and month (I need only week)
Plugin has 3 rank modes: kills , deaths and time beeing in server.
Plugin resets ranks every day, week or mont (If i set week mode it resets every week)
Command like /toptime shows top of the week or day or month
And winner of the day, week, month has some flags at next day, week or month. (I need eit flags so free vip)
I hope this is not bad idea !
This is almoust ready ... no auto reset and auto flag giving:
http://forums.alliedmods.net/showthread.php?p=457071
I found in forum this !
But this is manuall version
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <vault>
new connecttime[33], vault_time[21], authid[32]
public plugin_init(){
register_plugin("Admin Playtime Vault","1.0","Stein_R")
}
public client_authorized(id){
get_user_authid(id,authid,31)
if ((get_user_flags(id) & ADMIN_RESERVATION)) {
if(vaultdata_exists(authid)){
get_vaultdata(authid,vault_time,20)
connecttime[id] = str_to_num(vault_time)
}else{//No data exists
connecttime[id] = 0
}
}
return PLUGIN_CONTINUE
}
public client_disconnect (id){ //Update players time in the database
get_user_authid(id,authid,31)
if ((get_user_flags(id) & ADMIN_RESERVATION)) {
new playtime = get_user_time (id)
if(vaultdata_exists(authid)){
new tmp_vault_time,vault_time[21]
get_vaultdata(authid,vault_time,20)
tmp_vault_time = str_to_num(vault_time)
tmp_vault_time += playtime
num_to_str(tmp_vault_time,vault_time,20)
set_vaultdata(authid,vault_time)
}else{//create a record for them
num_to_str(playtime,vault_time,20)
set_vaultdata(authid,vault_time)
}
}
return PLUGIN_CONTINUE
}
Some other:
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)
}
__________________