Raised This Month: $ Target: $400
 0% 

Some timeleft calculations..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 05-14-2013 , 07:40   Re: Some timeleft calculations..
Reply With Quote #1

I want to initiate map voting & map change process in the end of map (gun game mod). Votemap process initializes when a timeleft value is 00-30 (seconds left).
This is a way: when a mapchenge is needed, we get elapsed map time (ex.: 15 mins and 14 secs) and summ him with 31 seconds = 15:45, then we set timeleft to 15:45. After 1 second votemap is in process..

Quote:
use this
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "asdf"
#define VERSION "1.0"
#define AUTHOR "asdf"

new Float:g_time

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("/elapsed","elapsed")

    
g_time get_gametime()
}


public 
elapsed()
{
    new 
Float:elapsed_time get_gametime() - g_time
    server_print
("elapsed time: %.2f",elapsed_time)

Is this way true?
__________________
sorry my bad english...

Last edited by alonelive; 05-14-2013 at 07:41.
alonelive 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 16:16.


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