Raised This Month: $ Target: $400
 0% 

Adding days, hours, seconds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-25-2012 , 23:42   Re: Adding days, hours, seconds
Reply With Quote #5

Quote:
Originally Posted by Liverwiz View Post
I'd rethink that too.....
LOL. Oh really? Why do you say that? Do I have to prove you wrong? I will if you want.

EDIT: I won't wait for your response:

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
set_task(5.0"runProof")
}

public 
runProof()
{
    new 
iTestTest 4687987
    
    
// Liverwiz's Method
    
new seconds iTestTest
    
new minutes seconds 60
    
new hours minutes 60
    
new days hours 24

    server_print
("^nLiverwiz's Method:")
    
server_print("%d Days %d Hours %d Minutes and %d Seconds"dayshoursminutesseconds)

    
// Fysiks' Method
    
new iDays iTestTest 86400
    
new iHours iTestTest 86400 3600
    
new iMinutes iTestTest 3600 60
    
new iSeconds iTestTest 60

    server_print
("^nFysiks' Method:")
    
server_print("%d Days %d Hours %d Minutes and %d Seconds"iDaysiHoursiMinutesiSeconds)

Yields:

Code:
Liverwiz's Method:
54 Days 1302 Hours 78133 Minutes and 4687987 Seconds

Fysiks' Method:
54 Days 6 Hours 13 Minutes and 7 Seconds
I'll let you decide which is correct.
__________________

Last edited by fysiks; 06-26-2012 at 00:02.
fysiks 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 06:16.


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