Raised This Month: $ Target: $400
 0% 

Solved Is there a native to pause timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 08-01-2022 , 13:19   Is there a native to pause timer
Reply With Quote #1

Hello Everyone,

I want an easy way to pause and resume timer, lets take this script by "RU_6uK" as an example

PHP Code:
float g_fSeconds;
bool g_bRoundEnd;

public 
void OnPluginStart()
{
    
HookEvent("player_left_safe_area"Event_LeftStartArea);
    
HookEvent("round_end"Event_RoundEnd);

    
RegConsoleCmd("sm_duration"Command_Duration"Display Round Duration To Chat");
}

public 
Action Event_LeftStartArea(Event event, const char[] namebool dontBroadcast)
{
    
g_fSeconds GetEngineTime();
    
g_bRoundEnd false;
    return 
Plugin_Handled;
}

public 
Action Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    if(!
g_bRoundEndg_bRoundEnd true;    
    return 
Plugin_Handled;
}

public 
Action Command_Duration(int clientint args)
{
    
int secDiff RoundToFloor(GetEngineTime() - g_fSeconds);
    
ReplyToCommand(client"\x04Round Duration: \x03%i min %i sec"secDiff 60secDiff 60);
    return 
Plugin_Handled;

Any method to pause it, is acceptable, with a command or event

Thanks

Last edited by alasfourom; 12-26-2022 at 04:18.
alasfourom 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 00:58.


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