Raised This Month: $ Target: $400
 0% 

Exec Command at isactly 12:00h


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 01-02-2016 , 05:26   Re: Exec Command at isactly 12:00h
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
I would do something like this:

PHP Code:
public CmdRestart()
{
    
// Get the current time
    
static iHouriMinuteiSecondiSecondsLeft
    time
(iHouriMinuteiSecond)
    
    if( 
iHour == 11 || iHour == 23 // Just in case this function gets executed some other time
    
{
        
// Calculate the seconds until the next hour
        
iSecondsLeft 3600 - (iMinute 60 iSecond)
        
        if( 
iSecondsLeft 60 == && iSecondsLeft 0)  // Every minute on the minute except when we restart
        
{
            
client_print(0print_chat"!gO servidor ira reiniciar automaticamente em !n%d!g minutos."iSecondsLeft 60)
        }
        else if( 
iSecondsLeft == 30 || iSecondsLeft == 15 || iSecondsLeft <= 10 // Select times
        
{
            
client_print(0print_chat"!gO servidor ira reiniciar automaticamente em !n%d!g segundos."iSecondsLeft)
        }
        else if( 
iSecondsLeft == )  // Restart on the hour
        
{
            
server_cmd("restart")
        }
    }

Thank you!
Syturi0 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 09:30.


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