View Single Post
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 05-24-2015 , 10:30   Re: [Help] Killing Timer
Reply With Quote #3

I guess I was wrong, I am no longer getting that error but the timers still carry out past the round end.

PHP Code:
new Handle:WardayStartTimer;
new 
Handle:WardayExpandTimer;

public 
wardayfreezetime(Handle:menuMenuAction:actionclientitemNum)
{
    if ( 
action == MenuAction_Select )
    {
        switch (
itemNum)
        {
            case 
0:
            {
                
WardayStartTimer CreateTimer(30.0WardayStart);
                new 
Handle:menu CreateMenu(wardayexpandtime);
                
SetMenuTitle(menu"Warday - Expand Time");
                
AddMenuItem(menu"option1""In 3 Minutes");
                
AddMenuItem(menu"option2""In 4 Minutes");
                
AddMenuItem(menu"option3""In 5 Minutes");
                
AddMenuItem(menu"option5""In 6 Minutes");
                
SetMenuExitButton(menutrue);
                
DisplayMenu(menuclientMENU_TIME_FOREVER);
                
                
ServerCommand("sm_freeze @t 30");
                
PrintToChatAll("[\x07Warden\x01] \x04Warday will start in\x01 \x0730\x01 \x04seconds!\x01");
                
PrintToChatAll("[\x07Warden\x01] \x04Guards, remember to open the cells before the freezetime is over.\x01");
            }
            case 
1:
            {
                
WardayStartTimer CreateTimer(45.0WardayStart);
                new 
Handle:menu CreateMenu(wardayexpandtime);
                
SetMenuTitle(menu"Warday - Expand Time");
                
AddMenuItem(menu"option1""In 3 Minutes");
                
AddMenuItem(menu"option2""In 4 Minutes");
                
AddMenuItem(menu"option3""In 5 Minutes");
                
AddMenuItem(menu"option5""In 6 Minutes");
                
SetMenuExitButton(menutrue);
                
DisplayMenu(menuclientMENU_TIME_FOREVER);
                
                
ServerCommand("sm_freeze @t 45");
                
PrintToChatAll("[\x07Warden\x01] \x04Warday will start in\x01 \x0745\x01 \x04seconds!\x01");
                
PrintToChatAll("[\x07Warden\x01] \x04Guards, remember to open the cells before the freezetime is over.\x01");
            }
            case 
2:
            {
                
WardayStartTimer CreateTimer(60.0WardayStart);
                new 
Handle:menu CreateMenu(wardayexpandtime);
                
SetMenuTitle(menu"Warday - Expand Time");
                
AddMenuItem(menu"option1""In 3 Minutes");
                
AddMenuItem(menu"option2""In 4 Minutes");
                
AddMenuItem(menu"option3""In 5 Minutes");
                
AddMenuItem(menu"option5""In 6 Minutes");
                
SetMenuExitButton(menutrue);
                
DisplayMenu(menuclientMENU_TIME_FOREVER);
                
                
ServerCommand("sm_freeze @t 60");
                
PrintToChatAll("[\x07Warden\x01] \x04Warday will start in\x01 \x0760\x01 \x04seconds!\x01");
                
PrintToChatAll("[\x07Warden\x01] \x04Guards, remember to open the cells before the freezetime is over.\x01");
            }
        }
    }
    else if (
action == MenuAction_End )
    {
    
CloseHandle(menu);
    } 
}

public 
wardayexpandtime(Handle:menuMenuAction:actionclientitemNum)
{
    if ( 
action == MenuAction_Select )
    {
        switch (
itemNum)
        { 
            case 
0:
            {
                
PrintToChatAll("[\x07Warden\x01] \x04Warday will expand in\x01 \x073\x01 \x04minutes!\x01");
                
WardayExpandTimer CreateTimer(180.0WardayExpand);
            }
            case 
1:
            {
                
PrintToChatAll("[\x07Warden\x01] \x04Warday will expand in\x01 \x074\x01 \x04minutes!\x01");
                
WardayExpandTimer CreateTimer(240.0WardayExpand);
            }
            
            case 
2:
            {
                
PrintToChatAll("[\x07Warden\x01] \x04Warday will expand in\x01 \x075\x01 \x04minutes!\x01");
                
WardayExpandTimer CreateTimer(300.0WardayExpand);
            }
            
            case 
3:
            {
                
PrintToChatAll("[\x07Warden\x01] \x04Warday will expand in\x01 \x076\x01 \x04minutes!\x01");
                
WardayExpandTimer CreateTimer(360.0WardayExpand);
            }
        }
    }
    else if (
action == MenuAction_End )
    {
    
CloseHandle(menu);
    } 
}

public 
Action:roundEnd(Handle:event, const String:name[], bool:dontBroadcast
{
    
ServerCommand("sm_gravity @all 1");
    
GravityFreeday 0;
    
KillTimer(WardayExpandTimer);
    
KillTimer(WardayStartTimer);

Addicted. is offline