Dice Posted January 10, 2013 Share Posted January 10, 2013 how can I make a script to show the realtime, i Know getRealtTime() but how can I get , let's say, Central Time, so I can display it on the server. Link to comment
Dice Posted January 10, 2013 Author Share Posted January 10, 2013 What? No i want the math or how I can get central time , or how I can do it. Link to comment
3NAD Posted January 10, 2013 Share Posted January 10, 2013 Look at the Ex. ( Wiki Page ) function showtime () local time = getRealTime() local hours = time.hour local minutes = time.minute outputChatBox ( "Local Time: "..hours..":"..minutes ) end addCommandHandler ( "time", showtime ) Link to comment
Moderators IIYAMA Posted January 10, 2013 Moderators Share Posted January 10, 2013 server function getthetime(player) local hour, minutes = getTime() local Thetimenow[1] = hour, minutes triggerClientEvent ( "store_the_time", getRootElement(), Thetimenow ) end addCommandHandler("whatisthetime", getthetime) --or local local Thetimenow[1] = getTime() client local hour, minutes = 0,0 addEvent( "store_the_time", true ) addEventHandler( "store_the_time", getRootElement(), ready_to_store ) function ready_to_store (Thetimenow) hour, minutes = Thetimenow[1] end GetTime or function getthetime(player) triggerClientEvent ( "store_the_time", getRootElement(), getTime() ) end addCommandHandler("whatisthetime", getthetime) local hour, minutes = 0,0 addEvent( "store_the_time", true ) addEventHandler( "store_the_time", getRootElement(), ready_to_store ) function ready_to_store (hour2, minutes2) hour, minutes = hour2, minutes2 end your question is incorrect, or I don't know... I don't get it... lol 3ήẰÐ was first, his sample is better. Link to comment
Dice Posted January 10, 2013 Author Share Posted January 10, 2013 No no, thanks, but what I mean is let's say someone lives in a place where the time is Eastern Time, so they do !Eastern Time and the time for Eastern time show's up? something like that? if it is possible Link to comment
Moderators IIYAMA Posted January 10, 2013 Moderators Share Posted January 10, 2013 (edited) See 3ήẰÐ his script, that's shows your own time. (not my lines, just for you to know and not stolen, from the community*) But: local realtime=string.format("%02d-%02d", getRealTime().hour, getRealTime().minute) outputChatBox(string.char(string.byte(realtime, i,i))) Edited January 10, 2013 by Guest Link to comment
3NAD Posted January 10, 2013 Share Posted January 10, 2013 Did you mean this : function showtime ( thePlayer ) country = exports.admin:getPlayerCountry ( thePlayer ) if country == "Saudi Arabia" or country == "SA" then time = getRealTime ( ) hours = time.hour + 3 minutes = time.minute outputChatBox ( "Local Time: "..hours..":"..minutes ) end end addCommandHandler ( "time", showtime ) Link to comment
Dice Posted January 10, 2013 Author Share Posted January 10, 2013 ahh exactly , thanks a lot. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now