Jump to content

getRealTime


Recommended Posts

Posted

السلآمم عليكمم ،

بغيت ممثآل لـ ففنكششن

getRealTime 

أنا رححت الويكي وششففت مثآل ، وففهممته = ]

بسس آبغى ششويةة أممثثلةة ثآنيةة للففنكششن ذآ

#

Posted

سسويتهه ذآ الكود ممن ققبل ،

آبغى أممثلةة ثآنيةة بسسس مرففقةة بالششرح #

:wink:

Posted
local rX, rY = guiGetScreenSize() -- حجم الشاشة 
function RelativeToAbsolute( X, Y ) -- وظيفة تعديل احداثيات الدي اكس لجميع الشاشات # 
        local x = X*rX 
        local y = Y*rY 
        return x, y 
end 
  
addEventHandler("onClientRender",root, -- اضافة حدث الرندر 
    function ( ) -- انشاء وظيفة 
        local CurrentTime = getRealTime() -- نجيب الوقت الحقيقي كآملآ بـ الجدول !! 
        local Hours = CurrentTime.hour -- هنا نجيب الوقت الحقيقي من الساعات 
        local Minute = CurrentTime.minute -- الوقت الحقيقي من الدقائق 
        local Secounds = CurrentTime.second -- الوقت الحقيقي من الثواني 
        local xs,ys = RelativeToAbsolute ( 0.28, 0.23 ) 
                dxDrawText("The Current Time is : "..Hours.." : "..Minute.." : "..Secounds.." ",xs,ys,rX,rY, tocolor(255,150, 0, 255),4, "arial", "center", "center", false, false, true, false, false) -- نرسم الجدول على الشاشة  
    end -- اغلاق 
) -- اغلاق 

Posted (edited)

يعططيكك العآففيةة يالغآلي

بسس ممآ ففهمت سسطر 14 وش يسسوي

local xs,ys = RelativeToAbsolute ( 0.28, 0.23 ) 

تققدر تششرححهه لي ؟

+ ذآ السسطر

dxDrawText("The Current Time is : "..Hours.." : "..Minute.." : "..Secounds.." ",xs,ys,rX,rY, tocolor(255,150, 0, 255),4, "arial", "center", "center", false, false, true, false, false) 
  

ليشش ححطينآ center center

وليشش بعد ممآ ححططينآ

false false false true true true ?

آو ممثلآ

false true false true true ?

+

"onClientRender" 

ليشش إسستعملتهآ ؟ = )

Edited by Guest
Posted

هذي احداثيات انا مسويها من الايديتور ريلاتف عشان وظيفة الاحداثيات حق الدي اكس

الاسئلة الثاني تقدر تشوف الويكي #

alignX: horizontal alignment of the text within the bounding box. Can be "left", "center" or "right".

alignY: vertical alignment of the text within the bounding box. Can be "top", "center" or "bottom".

clip: if set to true, the parts of the text that don't fit within the bounding box will be cut off.

wordBreak: if set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line.

postGUI: A bool representing whether the text should be drawn on top of or behind any ingame GUI (rendered by CEGUI).

colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set.

subPixelPositioning: A bool representing whether the text can be positioned sub-pixel-ly. Looks nicer for moving/scaling animations.

Posted

وكيف بتفهم بعدين ؟ هذي الاشياء تسمح لك كل شيء لة شيء مثلا تحط اكواد هيكس الوان # وتخلي الدي اكس مايغطي الشيء النافذهـ ..ألخ

center or center

هذي وين موقعه يعني بالنص الخ ولازم تجرب دايم وتتعلم ^

Posted

"onClientRender" 

مم ققلت لي ليشش إسستخدممتهآ :?

وهي حققت وششش !!

وشش تسسوي :D

تحديثث ؟

Posted

آففتححهه أححيآنآ #

بسس ممششكلتي ششوي ششوي بالإنجليزي :)

هنآ آججي عششآن إسستففسر ، وآففهمم

+ إنت تققول لآزمم تستخددمهآ للدي آكسس

تققدر تسوي لي عليهآ شي ثآني ؟

Posted

اكيد ! لها استخدامات كثيرة! وهي مثلا زي التايمر والافضل لـو توفرت تستخدمها بدال التايمر ! من نآحية الاق وآحيآنآ مآتصير وتضطر تستخدم التايمر ! يعني الحين لو تسوي لون الدي اكس رآندوم ! مآيحتاج تآيمر عشان الايفنت الرندر !

Posted
addEventHandler("onClientRender",getRootElement(), -- الايفنت 
    function ( ) -- وظيفة 
        local random =  math.random(1,5000) -- ارقام عشوائية بالشات 
        outputChatBox(tostring(random),math.random(255),math.random(255),math.random(255)) -- شات متكرر من الايفت تلقائي بدون تايمر 
    end -- اغلاق 
) -- اغلاق 
     

Posted

شف هالكود لو أنك مبرمج ذذ

root = getRootElement () 
function updateCamera () 
    local x, y, z = getElementPosition ( getLocalPlayer () ) 
    setCameraMatrix ( x, y, z + 50, x, y, z ) 
end 
addEventHandler ( "onClientRender", root, updateCamera ) 

Posted

حقك شوي بيخبص ^ ومآيجي صح فهمت اللي تبية سوية كذآ وبتصير الكآميرآ تروح فوق :

addEventHandler ( "onClientRender", getRootElement (),  
function  () 
    local x,y,z,xl,yl,zl = getCameraMatrix() 
    setCameraMatrix ( x,y,z +0.5,xl,yl,zl ) 
end 
) 

مثل التآيمر

Posted
طيب لو مثل يبيه يروح لليسار ويروح الماتركس ويصير ريسباون اللاعب ؟؟

يسوي getCameraMatrix

ويسوي شرط اذا وصل لـ كذا يسوي سباون ..

Posted
ممو نآيمم ، مششغول = ))

آبي ممثآل ع

"onClientRender" :mrgreen:

onClientRender الحدث :

يحدث كل ما اللعبة طلعت اب ديت لنفسها

يعني اقل من ملي ثانية, هذا مفيد في وظايف ال

dx

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