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

Members Online

»
0 Active | 97 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: Local time HUD
kimistatheone
General Member
Since: Mar 1, 2012
Posts: 47
Last: May 2, 2013
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Jan. 13, 2013 07:02 pm
hello,

i want to make a hud that writes the current date and/or the time.
i can make the hud, but i've no idea where can i get the local time. any variable? or it is impossible?
Share |
kimistatheone
General Member
Since: Mar 1, 2012
Posts: 47
Last: May 2, 2013
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Apr. 28, 2013 02:41 pm
hallo all,

no idea? :(

maybe from the games_mp.log? (but its the server uptime, not the current time).

can any function from c++, or javascript work in gsc ( now(), time(), date() or anything)?

Share |
twix90
General Member
Since: Jan 16, 2012
Posts: 15
Last: Apr 28, 2013
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Sunday, Apr. 28, 2013 03:07 pm
its not possible :D
Share |
Grorigan
General Member
Since: Mar 26, 2011
Posts: 66
Last: Jun 23, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Jun. 23, 2013 10:38 am
It's just an idea : When you start your server, let it knows the real current time with a variable. For example, if it is 4pm and 5 minutes and 42 seconds :
Code:
// rcon logged, of course
/rcon set real_time 1605,42


Then, you can just calculate the real time from the server time with the function :
Code:
getTime() // gives you the server time, in minutes


You can also use a timer, but make sure it counts up :
Code:
SetTimerUp

One for the hours, another one for minutes.
The problem is that after "59", it shows "60" and no "00". You will have to test it...

Hope I didn't write so much mistakes,
Bye [wave]

edited on Jun. 27, 2013 04:10 am by Grorigan
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

»