Jump to content

Central Time


Dice

Recommended Posts

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

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
  • Moderators

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 by Guest
Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...