Raised This Month: $ Target: $400
 0% 

Hud msg & timeleft help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-23-2009 , 11:29   Re: Hud msg & timeleft help
Reply With Quote #6

It seems as if there is a 12 second offset from the start of map to when the actual map-time countdown begins. This is probably caused by the restarting of map when all players connect after a map change and "game commencing" appears. There is probably a calculation method used to determine this number but it is consistently 12 seconds on my server.

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() 

    
register_plugin"Map Time Left" "0.1" "bugsy" );
    
set_task( ( get_cvar_float("mp_timelimit") * 60.0 ) - 108.0 "set_timer" );
}

public 
show_timer()

    new 
szNextMap[32];
    
    
get_cvar_string"amx_nextmap" szNextMap 31 );
    new 
iTimeLeft get_timeleft();
    
    
set_hudmessage255 255 255 0.75 0.05 1.0 1.0 0.1 0.2 13 ); 
    
show_hudmessage"Time remaining: %d:%02d^nNext map: %s" iTimeLeft 60 iTimeLeft 60 szNextMap );
    
    return 
PLUGIN_CONTINUE 


public 
set_timer()
{
    
set_task1.0 "show_timer" ___"b" );

__________________

Last edited by Bugsy; 03-23-2009 at 11:31.
Bugsy is offline
 



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 08:58.


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