Raised This Month: $ Target: $400
 0% 

[HELP] Plugin resets every map change?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
deathmarch06
Member
Join Date: Apr 2008
Old 05-17-2009 , 04:16   [HELP] Plugin resets every map change?
Reply With Quote #1

Hello,

I wanna make the following plugin work so that it remembers how much time is left unless the server is reset.

Currently the timer works, but whenever the map changes it resets and I don't know how to fix this.

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

new g_counter
new hour, minute, second

public plugin_init() 
{
    register_plugin("LethaL Gaming Restarter","1.0","Matt/AnuBi")
    //1 hour * 6
    g_counter = 3600 * 6
        
    set_task(1.0, "CountDown", 0, "", 0, "b")
}

public CountDown()
{
    if(!g_counter--)
    {
        server_cmd("restart")
        return
    }
              
        hour = g_counter / 3600
        minute = g_counter % 3600 / 60
        second = g_counter % 3600 % 60
        set_hudmessage(0, 100, 0, 1.35, -1.35, 0, 0.01, 1.0, 0.01, 0.01, 4)
        //show_hudmessage(0, "%d Seconds Until Server Restart.", g_counter)
        show_hudmessage(0,"%02d:%02d:%02d Left",hour,minute,second)
}
Any help appreciated.

Regards,
Matt/AnuBi.
deathmarch06 is offline
 


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


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