Ja[B]er[X]Pro Posted May 2, 2016 Share Posted May 2, 2016 السلام عليكم ورحمة الله وبركاته سويت مود بسيط وهو الوقت الحقيقي بالسيرفر يوجد مشكلتان الاولى هي ان الساعة 7 تيجي 19 والمشكلة الثانية بأن الساعة مثال 7:16 ما تتغير وتبقى كما هي local time = getRealTime() local hours = time.hour local minutes = time.minute GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(711, 141, 79, 33, ""..hours..":"..minutes.."", false) guiSetFont(GUIEditor.label[1], "sa-header") end ) addEventHandler("onClientRender",root,function() guiSetText(GUIEditor.label[1],""..hours..":"..minutes.."") end) Link to comment
[iMr]-W[i]Fi,.! Posted May 2, 2016 Share Posted May 2, 2016 جرب local time = getRealTime() local hours = time.hour local minutes = time.minute RealTimeText = guiCreateLabel(711, 141, 79, 33, " "..hours..":"..minutes.." ", false) guiSetFont(RealTimeText, "sa-header") Link to comment
iMr.SFA7 Posted May 2, 2016 Share Posted May 2, 2016 GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(711, 141, 79, 33, ""..hours..":"..minutes.."", false) guiSetFont(GUIEditor.label[1], "sa-header") end ) addEventHandler("onClientRender",root,function() local time = getRealTime() local hours = time.hour local minutes = time.minute guiSetText(GUIEditor.label[1],""..hours..":"..minutes.."") end) 'onClientRender' الخطأ عندكـ هو أنك جبت الوقت في بدايـة تشغـيل السكربت 'الكـلنت' والمـفروض تجيـبه دآخل الحـدث Link to comment
HassoN Posted May 2, 2016 Share Posted May 2, 2016 حل مشكلتك الاولى هو وظيفة تقوم بارجاع الوقت الحقيقي وتحويله من 24 ساعة الى 12 ساعة The function returns real time with convert 24h to 12h Shared function string getTime( ) function getTime( ) local time = getRealTime( ) local h, m = time.hour, time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 شكرأً لكم ممكن تصحيح ERROR: Time\C.lua:9: attempt to conactenate gloal 'm' (a nill value) function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 79, 33, ""..h..":"..m.."", false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() guiSetText(TIME,""..h..":"..m.."") end) Link to comment
iMr.SFA7 Posted May 2, 2016 Share Posted May 2, 2016 function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 79, 33, "", false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() local h,m = getTime() guiSetText(TIME,""..tostring(h)..":"..tostring(m).."") end) Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 79, 33, "", false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() local h,m = getTime() guiSetText(TIME,""..tostring(h)..":"..tostring(m).."") end) ERROR Time\C.lya:13: attempt to conactenate local 'm' (a nil value) Link to comment
HassoN Posted May 2, 2016 Share Posted May 2, 2016 function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 79, 33, tostring(getTime()), false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() guiSetText(TIME,tostring(getTime())) end) Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 . أنسخـه مرة ثانـية شكراً لك ولكل شخص ساعدني يجيني الساعة 9:42 PM:nil كيف امسح ال nil ?? Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 ضفت الثواني صار يجي 9:49 PM:nill:nill function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 79, 33, "", false) addEventHandler("onClientRender",root,function() local h,m,s = getTime() guiSetText(TIME,""..tostring(h)..":"..tostring(m)..":"..tostring(s).."") end) ما هو الحل؟ Link to comment
iMr.SFA7 Posted May 2, 2016 Share Posted May 2, 2016 !بـس 'PM' آمم غـريبة أنا يجيني ع العمـوم جربـه كـذآ: function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,""..tostring(time).."") end) Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 !بـس 'PM' آمم غـريبة أنا يجيني ع العمـوم جربـه كـذآ: function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) guiSetFont(TIME, "sa-header") addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,""..tostring(time).."") end) شكراً لك اختفت ال nil لكن ماذا عن الثواني ما تظهر function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m).." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,""..tostring(time).."") end) Link to comment
iMr.SFA7 Posted May 2, 2016 Share Posted May 2, 2016 getTime قـم بتعديـل الوظيفة: function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m)..":"..s.." "..(h >= 12 and "PM" or "AM") end Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 getTime قـم بتعديـل الوظيفة: function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second return (h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m)..":"..s.." "..(h >= 12 and "PM" or "AM") end شكرأًً لك ولكل شخص ساعدني Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 سؤال اخر كيف اجيب التاريخ ؟ Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 getRealTime شكراً لك على المساعدة Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 المود صار ما يشتغل function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second local y = time.year local m = time.month local d = time.monthday return y.."-"..m.."-"..d.." "(h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m)..":"..s.." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,"["..tostring(time).."]") end) الدي بق يقول سطر 9 end Link to comment
#DRAGON!FIRE Posted May 2, 2016 Share Posted May 2, 2016 function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second local y = time.year local m = time.month local d = time.monthday return y.."-"..m.."-"..d.." "..(h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m)..":"..s.." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,"["..tostring(time).."]") end) Link to comment
Ja[B]er[X]Pro Posted May 2, 2016 Author Share Posted May 2, 2016 function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second local y = time.year local m = time.month local d = time.monthday return y.."-"..m.."-"..d.." "..(h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m)..":"..s.." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,"["..tostring(time).."]") end) شكراً لك يوجد مشكلة السنة تيجي 116 Link to comment
#DRAGON!FIRE Posted May 2, 2016 Share Posted May 2, 2016 function getTime( ) local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second local y = time.year+1900 local m = time.month local d = time.monthday return y.."-"..m.."-"..d.." "..(h % 12 and h % 12 or 12)..":"..(m < 10 and "0"..m or m)..":"..s.." "..(h >= 12 and "PM" or "AM") end TIME = guiCreateLabel(711, 141, 140, 40, "", false) addEventHandler("onClientRender",root,function() local time = getTime() guiSetText(TIME,"["..tostring(time).."]") end) Link to comment
iMr.SFA7 Posted May 3, 2016 Share Posted May 3, 2016 سوي زيـادة للشـهر بعد +1 local m = time.month +1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now