print( os.time() ) Variable for HUD

Hello,

I make a HUD for my server and i want add a Time and Date in …

But i have this

draw.DrawText("test: "… Wallet, “Arial”, HUD.PosX - (wallettextsize /2) + 140, HUD.PosY + 60, Color(0, 255, 0, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)

for

How to place this ?

print( os.time() )

Thank man

os.date

Format it, put it in a var, draw it.

Thank but i don’t unterstand ? code ?

Read this:

Welcome to the Development discussion forum, where people help you understand and dont serve you code on a plate.

Thank !

[editline]12th October 2015[/editline]

Thank but Format it, put it in a var, draw it. it’s not reply …

Thats how basic lua works - formating it, putting it in a var, and then drawing it/using the var.
Format the UNIX time of os.time() to an actualy “Dateish” time, put it inside a local var, and draw it, not that hard.

To draw the time (using your example)



local time = os.date( '%I:%M %p' ) -- Returns something like 04:40 pm

draw.DrawText("Time: ".. time, "Arial", HUD.PosX - (wallettextsize /2) + 140, HUD.PosY + 60, Color(0, 255, 0, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)


Okay i have included ! Thank , now i make this for Mouth Thank man !

For people that rated my post dumb, I forgot to add that you could change the string to whatever you want using the website AIX-Who linked.

I rated it dumb because you spoonfeed him :confused:

He kinda asked for it, and it’s not really spoonfeeding if it’s just adapting stuff from other examples into his code-he would’ve done that kinda thing anyway