Jump to content

Time Code


Recommended Posts

سلام عليكم

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

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
Link to comment
سلام عليكم

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

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 ) 
  

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