Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 92 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Time Spent Online
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Dec. 14, 2013 11:51 am
Hi there,

I am counting the seconds for every individual player while they are playing. (I mean the time spent online).

It is working well, I just don't have any ideas how to converting the seconds to mintues, the minutes to hours, the hours to days, etc...

I guess something like:
Code:

self.time_spent = self.time_spent / 60; // Minutes

But I think if I do that it will write for exmaple 1.47 Minutes and not 1 minutes 47 seconds.
Share |
robert119966
General Member
Since: Feb 12, 2012
Posts: 19
Last: Feb 7, 2014
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Saturday, Dec. 14, 2013 12:12 pm
need help ? xf ; czolk

test this :
Code:
for(;;)
{
	self.sec += 1;
	
	if(self.sec == 60)
	{
		self.sec = 0;
		self.hour += 1;
	}
	if(self.hour == 60)
	{
		self.hour = 0;
		self.day += 1;
	}
	wait 1;
}
Share |
Donefore
General Member
Since: May 1, 2009
Posts: 165
Last: Sep 20, 2018
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Dec. 14, 2013 03:59 pm
gametracker does this for you already
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»