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

[Req]Time Display X Min | Hour


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stressful
Senior Member
Join Date: Feb 2011
Old 02-11-2011 , 22:53   [Req]Time Display X Min | Hour
Reply With Quote #1

I need a plugin which automatically after X minute or X hour , It will display how long we've played in the server.
Like print_chat "You've played X hour & X minute in this server"
__________________

Last edited by Stressful; 02-12-2011 at 01:55.
Stressful is offline
Stressful
Senior Member
Join Date: Feb 2011
Old 02-25-2011 , 00:31   Re: [Req]Time Display X Min | Hour
Reply With Quote #2

Bump.
__________________
Stressful is offline
Stressful
Senior Member
Join Date: Feb 2011
Old 03-15-2011 , 02:07   Re: [Req]Time Display X Min | Hour
Reply With Quote #3

Can someone just help me edit part of this plugin ? I only nid the played time part .
PHP Code:
/* AMXModX Plugin
*
* Author: eXoR
*
* Version: 1.1a
*
* CVars & Commands:
* cvar:    sm_admins 1|0            |    0 = All Users can use the Status Monitor, 1 = Only admins can use the Status Monitor
* cvar: sm_admin_pw                |    Set the Admin Pw for custom Admins (setinfo "s_m_pw" "your password")
* cmd:     status (say)            |    Shows the Status monitor
* cmd:    status_mon (Console)    |    Shows the Status Monitor

*
* Credits:
* KleeneX (For Helping)
*
*/

#include <amxmodx> 
#include <amxmisc>
 
// Configure this if you would chage the path of the config file
new configfile[] = "addons/amxmodx/configs/status_monitor.cfg" 

new show_status[33]

public 
plugin_init() {
    
register_plugin("statusmonitor","1.1a","eXoR")
    
    
register_cvar("sm_admins","0")
    
register_cvar("sm_admin_pw","!noob!"
    
    
register_clcmd("say","check_say"
    
register_clcmd("say_team","check_say"
    
register_concmd("status_mon","statusmonitor",ADMIN_LEVEL_A,"Shows the status monitor")
    
register_concmd("sm_admins","smadminhelp",ADMIN_LEVEL_A,"Define if the Status Monitor is only for Admins")
    
register_concmd("sm_admin_pw","smadminhelp_pw",ADMIN_LEVEL_A,"Define a Password for using custom Admins")
    
    
set_task(1.0,"status",1621,"",1,"b")
    
    
server_cmd("exec %s",configfile)
}

public 
client_putinserver(id) {
    
set_task(1.0,"serverconnect")
}

public 
serverconnect(id,level,cid) {
    if(
get_cvar_num("sm_admins") == 0){
         
set_task(4.0,"checkshowstatus",id)    
    }else{
        new 
rem[32]
        new 
statusmon_pw_text[32]
        
get_user_info(id,"s_m_pw",rem,31)
        
get_cvar_string("sm_admin_pw",statusmon_pw_text,31)
        if(
cmd_access(id,level,cid,1) || equali(rem,statusmon_pw_text)){
            
set_task(4.0,"checkshowstatus",id)
            
set_task(5.0,"adminusersay",id)
        }
    }
}

public 
adminusersay(id,level,cid) {
        new 
rem[32]
        new 
statusmon_pw_text[32]
        
get_user_info(id,"s_m_pw",rem,31)
        
get_cvar_string("sm_admin_pw",statusmon_pw_text,31)
        if(
cmd_access(id,level,cid,1) || equali(rem,statusmon_pw_text)) {
            
client_print(id,print_chat,"[S-M]  You have Admin rights to use the Stauts Monitor!")
        }
}

public 
smadminhelp(id,level,cid) {
    if(!
cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
    
    
new cmd1[32]
    
read_argv(1,cmd1,31)
    if(
cmd1[0]) {  
        new 
act str_to_num(cmd1)
        
set_cvar_num("sm_admins",act
    } 
    
    new 
statusmonitrocvar get_cvar_num("sm_admins")
    
client_print(id,print_console,"sm_admins is ^"%d^"^n  0 = All Users, 1 = Only Admins",statusmonitrocvar)
    return 
PLUGIN_HANDLED
}

public 
smadminhelp_pw(id,level,cid) {
    if(!
cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
    
    
new cmd2[32]
    
read_argv(1,cmd2,31)
    if(
cmd2[0]) {
        
set_cvar_string("sm_admin_pw",cmd2
    } 
    
    new 
statusmonitrocvar_pw[32]
    
get_cvar_string("sm_admin_pw",statusmonitrocvar_pw,31)
    
client_print(id,print_console,"sm_admin_pw is ^"%s^"^n^n  This is used for custom Admins! You must set the Password with^n   setinfo ^"s_m_pw^" ^"%s^"",statusmonitrocvar_pw,statusmonitrocvar_pw)
    return 
PLUGIN_HANDLED
}

public 
checkshowstatus(id) {
    new 
rem[32]
    
get_user_info(id,"status_monitor",rem,31)
    new 
nb str_to_numrem )
    if(
nb == 1){ 
    
show_status[id] = 
    
}else{ 
    
show_status[id] = 
    
}
}
 
public 
client_disconnect(id) { 
    if(
show_status[id] == 0) {
        
client_cmd(id,"setinfo ^"status_monitor^" ^"0^"")
    }else{
        
client_cmd(id,"setinfo ^"status_monitor^" ^"1^"")
    }


public 
statusmonitor(id,level,cid) {
    if(
get_cvar_num("sm_admins") == 0){
        if(
show_status[id] == 0) {
    
            
show_status[id] = 
         
            client_cmd
(id,"spk ^"status screen activated^""
            
client_print(id,print_chat,"[S-M]  The Status Monitor will be showed at the next server connect"
            
client_print(id,print_center,"Status Monitor Activated")
            
client_cmd(id,"setinfo ^"status_monitor^" ^"1^"")     
        
        }else{ 
    
            
show_status[id] = 0

            client_cmd
(id,"spk ^"status screen deactivated^"")
            
client_print(id,print_chat,"[S-M]  The Status Monitor will be longer showed at the next server connect")
            
client_print(id,print_center,"Status Monitor Deactivated")
            
client_cmd(id,"setinfo ^"status_monitor^" ^"0^"")
        }
    }else{
        new 
rem[32]
        new 
statusmon_pw_text[32]
        
get_user_info(id,"s_m_pw",rem,31)
        
get_cvar_string("sm_admin_pw",statusmon_pw_text,31)
        if(
cmd_access(id,level,cid,1) || !equali(rem,statusmon_pw_text)) {
            
client_print(id,print_chat,"[S-M]  Only Admins can use the Status Monitor, sorry")
            return 
PLUGIN_HANDLED
        
}else{
            if(
show_status[id] == 0) {
    
                
show_status[id] = 
         
                client_cmd
(id,"spk ^"status screen activated^""
                
client_print(id,print_chat,"[S-M]  The Status Monitor will be showed at the next server connect"
                
client_print(id,print_center,"Status Monitor Activated")
                
client_cmd(id,"setinfo ^"status_monitor^" ^"1^"")
        
            }else{ 
    
                
show_status[id] = 0

                client_cmd
(id,"spk ^"status screen deactivated^"")
                
client_print(id,print_chat,"[S-M]  The Status Monitor will be longer showed at the next server connect")
                
client_print(id,print_center,"Status Monitor Deactivated")
                
client_cmd(id,"setinfo ^"status_monitor^" ^"0^""
            }
        }
    }
    return 
PLUGIN_HANDLED
}

public 
status() {  
    for(new 
id 1id 33id++) {  
        if(
show_status[id]) {  
            new 
ping,loss
            
new frags get_user_frags(id)
            new 
deaths get_user_deaths(id)
            new 
timer get_user_time(id)
            new 
timeleft get_timeleft()
            new 
cmin timer/60
            
new csec timer-cmin*60
            
new ctime[64]
            new 
nick[255]
            new 
ip[255]
            new 
cmax get_maxplayers() 
            new 
players get_playersnum() 
             new 
slots cmax-players
            
new Players[32]
            new 
playercount
            
            timeleft 
/= 60
            get_players
(Playersplayercount)
            
get_user_name(id,nick,254)        
            
get_user_ip(id,ip,254,1)                
            
get_user_ping(id,ping,loss)
            
get_time("%H:%M:%S",ctime,63)
            
            
set_hudmessage(100,255,0,0.50,0.02,0,0.0,1.090.00.02)
            
show_hudmessage(id,"Played time: %d Min  %d Secs^nTime: %s^nTimeleft: %d Min^n%d Slots Free / %d Active Players",cmin,csec,ctime,timeleft,slots,Players)
            
set_hudmessage(100,255,0,0.17,0.02,0,0.0,1.090.00.03)
            
show_hudmessage(id,"Ping: %d^nFrags: %d / Deaths: %d^nYour IP: %s^nYour Nick: %s",ping,frags,deaths,ip,nick)
        }
    }
}

public 
check_say(id,level,cid) {
    new 
said[32]
    
read_args(said,31)

    if (
equali(said,"^"/status^"") || equali(said,"^"status^""))
        
statusmonitor(id,level,cid)
    return 
PLUGIN_CONTINUE

Plugin Link : Status Monitor
__________________
Stressful is offline
Old 03-25-2011, 05:22
Stressful
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Stressful
Senior Member
Join Date: Feb 2011
Old 06-11-2011 , 08:00   Re: [Req]Time Display X Min | Hour
Reply With Quote #4

BUMP#!$$%$#^357547
__________________
Stressful is offline
Shadymn
Senior Member
Join Date: Sep 2010
Old 06-12-2011 , 05:19   Re: [Req]Time Display X Min | Hour
Reply With Quote #5

use it. statsx_shell 1.2.1 or mastaman edition 2.0.0[BETA]
this is very great plugin
Shadymn is offline
Stressful
Senior Member
Join Date: Feb 2011
Old 06-12-2011 , 23:19   Re: [Req]Time Display X Min | Hour
Reply With Quote #6

Isn't that ranking stuff? :O
__________________
Stressful is offline
Reply


Thread Tools
Display Modes

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 09:01.


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