Raised This Month: $ Target: $400
 0% 

[REG][IDEA] Top player of the week


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alien100
Member
Join Date: May 2010
Location: Finland
Old 06-07-2011 , 18:19   [REG][IDEA] Top player of the week
Reply With Quote #1

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(PLUGINVERSION"ConnorMcLeod"
    
register_dictionary("time.txt"

    
g_iVault nvault_open("played_time"

    
register_clcmd("say /playtime""ClientCommand_PlayedTime"


public 
plugin_end() 

    
nvault_closeg_iVault 


public 
client_authorizedid 

    
get_user_authid(idg_szSteamId[id], charsmax(g_szSteamId[])) 

    new 
szTime[32
    
nvault_get(g_iVaultg_szSteamId[id], szTimecharsmax(szTime)) 
    
g_iLastPlayedTime[id] = str_to_num(szTime


get_user_total_playtimeid 

    return 
g_iLastPlayedTime[id] + get_user_time(id


public 
ClientCommand_PlayedTimeid 

    new 
szTime[128
    
get_time_length(idget_user_total_playtimeid ), timeunit_secondsszTimecharsmax(szTime)) 
    
client_printidprint_chat"Played time : %s"szTime 


public 
client_disconnectid 

    new 
szTime[32
    
formatex(szTimecharsmax(szTime), "%d"get_user_total_playtimeid )) 
    
nvault_set(g_iVaultg_szSteamId[id], szTime

__________________

Last edited by alien100; 06-07-2011 at 18:38.
alien100 is offline
Send a message via MSN to alien100 Send a message via Skype™ to alien100
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 03:58.


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