Jump to content

فنكشات التاريخ


EL-JoKeR

Recommended Posts

Member Meaning Range

second seconds after the minute 0-61*

minute minutes after the hour 0-59

hour hours since midnight 0-23

monthday day of the month 1-31

month months since January 0-11

year years since 1900

weekday days since Sunday 0-6

yearday days since January 1 0-365

isdst Daylight Saving Time flag

timestamp seconds since 1970 (Ignoring set timezone)

Link to comment

مثال بسيط:

addCommandHandler ( "Time", function() 
    local Time = getRealTime() 
    local monthday = Time.monthday 
    local month = Time.month 
    local year = Time.year 
    outputChatBox ( "Local Time: "..monthday..":"..month..":"..year ) 
end) 

Time ارسل ب اف8

الكود زي م تحب سيرفر او كلنت ومع الفرق اكيد الكلنت لك لوحدك والسيرفر بتظهر للجميع

Link to comment

تقدر تستفيد من هذا الفنكشن

function _getRealTime (   ) 
    local time = getRealTime (  ) 
    local mo = time.month+1 
    local md = time.monthday 
    if ( tonumber ( md ) < 10 ) then 
        md = "0"..md 
    end 
    if ( tonumber ( mo ) < 10 ) then 
         mo = "0"..mo 
    end 
  return  md.."/"..mo.."/"..tostring ( tonumber ( time.year + 1900 ) ) 
end 
Link to comment
مثال بسيط:
addCommandHandler ( "Time", function() 
    local Time = getRealTime() 
    local monthday = Time.monthday 
    local month = Time.month 
    local year = Time.year 
    outputChatBox ( "Local Time: "..monthday..":"..month..":"..year ) 
end) 

Time ارسل ب اف8

الكود زي م تحب سيرفر او كلنت ومع الفرق اكيد الكلنت لك لوحدك والسيرفر بتظهر للجميع

Local Time: 11:0:115

يجي المعلومات غلط ليش ؟

زاحف مش فاهم شيء من كودك

Link to comment

مثلأ :

function _getRealTime (   ) 
    local time = getRealTime (  ) 
    local mo = time.month+1 
    local md = time.monthday 
    if ( tonumber ( md ) < 10 ) then 
        md = "0"..md 
    end 
    if ( tonumber ( mo ) < 10 ) then 
         mo = "0"..mo 
    end 
  return  md.."/"..mo.."/"..tostring ( tonumber ( time.year + 1900 ) ) 
end 
  
addCommandHandler ( "myTime", function (  ) 
     outputChatBox ( _getRealTime (   ) ) 
end ) 
Link to comment
مثلأ :

function _getRealTime (   ) 
    local time = getRealTime (  ) 
    local mo = time.month+1 
    local md = time.monthday 
    if ( tonumber ( md ) < 10 ) then 
        md = "0"..md 
    end 
    if ( tonumber ( mo ) < 10 ) then 
         mo = "0"..mo 
    end 
  return  md.."/"..mo.."/"..tostring ( tonumber ( time.year + 1900 ) ) 
end 
  
addCommandHandler ( "myTime", function (  ) 
     outputChatBox ( _getRealTime (   ) ) 
end ) 

ضع الوظيفة بصفحة الوظائف المفيدة في الويكي ليستفيد الآخرين

Link to comment

الحين انت مسوي سكربت الوقت الحقيقي , ولا تعرف تسوي التاريخ ؟؟ :lol:

كلها نفس الفنكشن

getRealTime 

وهذا كودك حق الوقت

addEventHandler("onClientRender", root, function (  ) 
  
    local hours = getRealTime (  ).hour 
    local minutes = getRealTime (  ).minute 
    local seconds = getRealTime (  ).second 
   
    dxDrawText(hours..":"..minutes..":"..seconds,38, 578, 177, 590,tocolor(4,184,255,255),0.8,"bankgothic") 
    end 
) 

وشف امثلة الشباب بتستفيد

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