Jump to content

Time Code


Recommended Posts

Posted

السسلآآم عليكم ورحمة الله وبركاته

شبـآآب ابي كود اذا واحد كتب بـ آف 8 مثلا Time

يطلع لهه الوقت اللي من وضيفة

setTimer 

وششكراا 8)

Posted (edited)

سلام عليكم

اولا يجب استخدام

getRealTime() 

وظيفته الحصول على وقت الاصلي او الحقيقي

وهدة الكود عملتلك اياه ادة واحد كتب بشات يطلع وقت الي كتبه

function chat (msg,msgty) 
if msg then 
mymsg = msg 
name= getPlayerName(source) 
thetime = getRealTime() 
h = thetime.hour 
m = thetime.minute 
outputChatBox(""..name.." : "..mymsg.." at "..h..":"..m.."") 
cancelEvent() 
end 
end 
addEventHandler ("onPlayerChat",getRootElement() , chat) 

Edited by Guest
Posted

هدة الكود كمان عملتلك ياه

  
function chat (cmd) 
thetime = getRealTime() 
h = thetime.hour 
m = thetime.minute 
s = thetime.second 
outputChatBox("the time is:"..h..":"..m..":"..s.."") 
end 
addCommandHandler("a",chat) 

Posted
سلام عليكم

اولا يجب استخدام

getRealTime() 

وظيفته الحصول على وقت الاصلي او الحقيقي

وهدة الكود عملتلك اياه ادة واحد كتب بشات يطلع وقت الي كتبه

function chat (msg,msgty) 
if msg then 
mymsg = msg 
name= getPlayerName(source) 
thetime = getRealTime() 
h = thetime.hour 
m = thetime.minutes 
outputChatBox(""..name.." : "..mymsg.." at "..h..":"..m.."") 
cancelEvent() 
end 
end 
addEventHandler ("onPlayerChat",getRootElement() , chat) 

  
function chat ( msg ) 
    if msg ~= " " then 
        name = getPlayerName ( source ) 
        r, b, g = getPlayerNametagColor ( source ) 
        thetime = getRealTime ( ) 
        h = thetime.hour 
        m = thetime.minute 
        outputChatBox ( "["..h..":"..m.."] "..name..": #FFffFF"..msg, root, r, b, g, true ) 
        cancelEvent ( ) 
    end 
end 
addEventHandler ( "onPlayerChat", root, chat ) 
  

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...