Raised This Month: $ Target: $400
 0% 

remaining round time


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-25-2007 , 17:11   Re: remaining round time
Reply With Quote #6

You're right about get_systime that's better than set_task.
I wonder what is better to use, get_gametime or get_systime... (except the fact that one is Float).

But considering that mp_roundtime can be changed by an admin after the begining of a round, i think it's better to use a global and to set it each begining of round.

I think that this should do the trick :
Code:
#include <amxmodx> new started_time ,rt new roundtime public plugin_init() {     register_plugin("NAME","VERSION","AUTHOR")         register_logevent("eRoundStart", 2, "1=Round_Start")         roundtime = get_cvar_pointer("mp_roundtime")         register_clcmd("test","testCmd") } public eRoundStart() {     started_time = get_systime()     rt = floatround(floatmul(get_pcvar_float(roundtime), 60.0)) - 1 } get_remaining_seconds() {     new seconds_left = rt - (get_systime() - started_time)     return seconds_left } public testCmd(id) {     client_print(id, print_chat, "%i seconds remaining", get_remaining_seconds())     return PLUGIN_HANDLED }

Last edited by ConnorMcLeod; 08-25-2007 at 17:16.
ConnorMcLeod 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 16:13.


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