Raised This Month: $ Target: $400
 0% 

[Help] TIME


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 03-08-2017 , 06:37   [Help] TIME
Reply With Quote #1

I need a little bit of help here, when i say rtv I want the plugin to display a emssage if 15 minutes were not elapsed since the map started, telling the client id how many mintues he must wait before saying rtv. If 100% fo the active players are saying rtv, it should ignore the timecheck and directly return the client emssage Time elapsed. Thanks!

Code:
#include <amxmodx>

new g_iHours, g_iMinutes, g_iSeconds;
new szMapName[ 32 ];

public plugin_init( )
{
    register_plugin("Map Voter", "1.0", "DarthMan")	
    register_clcmd( "say currentmap" , "current_map" )
    register_clcmd( "say_team currentmap" , "current_map" )
    register_clcmd( "say timeleft" , "timeleft" )
    register_clcmd( "say_team timeleft" , "timeleft" )
}

public current_map( id )
{
    new iGetGameTime = floatround( get_gametime( ) );
    g_iHours = iGetGameTime / 3600;    
    g_iMinutes = iGetGameTime / 60;
    g_iSeconds = iGetGameTime % 60;
    get_mapname( szMapName, charsmax( szMapName ) );
    client_print( id , print_chat, "Current map is %s and has been on for %d hours, %d minutes, and %d seconds.",szMapName, g_iHours, g_iMinutes, g_iSeconds );
    return PLUGIN_HANDLED;  
}

public timeleft( id )
{
    new iGetTimeLeft = get_timeleft( );
    g_iHours = iGetTimeLeft / 3600;    
    g_iMinutes = iGetTimeLeft / 60;
    g_iSeconds = iGetTimeLeft % 60;
    if (get_cvar_num("mp_timelimit")!=0)
    client_print( id , print_chat, "Time left: %d hours, %d minutes, and %d seconds.",g_iHours, g_iMinutes, g_iSeconds );
    if (get_cvar_num("mp_timelimit")==0)
    client_print( id , print_chat, "Time left: unlimited." );
    return PLUGIN_HANDLED; 
}

Last edited by DarthMan; 03-08-2017 at 07:23.
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 03-08-2017 , 07:11   Re: [Help] TIME
Reply With Quote #2

I did the infinite text string displayer myself, I just found the command to get the cvar value.
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 03-10-2017 , 14:26   Re: [Help] TIME
Reply With Quote #3

Please close this topic
DarthMan is offline
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 17:46.


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