Mr.Mostafa Posted August 27, 2018 Share Posted August 27, 2018 سلام عليكم آلحين آنآ جآيب تآيمر من آلسيرفر وحآطه بآلكلينت بدي آكس وآبي آسوي كل ثآنية لو آلتآيمر آقل من آو يسآوي 3 , يغير كلمة محددة بآلدي آكس لكن آلمشكلة تظبط لمآ يكون آلتآيمر آقل من آو يسآوي 30 مدري شسآلفة مزود 10 setTimer(function() if theTimer <= "3" then text = "آقل من 3 " end end,1000,0) ----- setTimer( function() local timerMission = convertMilliseconds( getTimerDetails(timer) ) if isTimer(timer) then triggerClientEvent( root, "timeStart2", root, timerMission ) end end, 50, 0 ) ------ addEvent("timeStart2", true) addEventHandler("timeStart2", root, function( timerMission ) theTimer = "".. timerMission .."" end ) Link to comment
Mr.Mostafa Posted August 27, 2018 Author Share Posted August 27, 2018 17 minutes ago, Trefeor said: اطرح الكلنت 19 minutes ago, Mr.Mostafa said: addEvent("timeStart2", true) addEventHandler("timeStart2", root, function( timerMission ) theTimer = "".. timerMission .."" end ) addEventHandler("onClientRender", root, function() dxDrawText(""..theTimer.."", 68 - 1, 414 - 1, 98 - 1, 430 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 + 1, 414 - 1, 98 + 1, 430 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 - 1, 414 + 1, 98 - 1, 430 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 + 1, 414 + 1, 98 + 1, 430 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68, 414, 98, 430, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) end ) Link to comment
Trefeor Posted August 27, 2018 Share Posted August 27, 2018 اطرح وظيفة convertMilliseconds Link to comment
Mr.Mostafa Posted August 27, 2018 Author Share Posted August 27, 2018 function convertMilliseconds( i ) if ( i ) then sec = math.fmod( math.floor( i / 1000 ), 60 ) return string.format( '%2d', sec ) end end Link to comment
Trefeor Posted August 27, 2018 Share Posted August 27, 2018 هو راح يرجع لك سلسلة نصية 'string' فـ تحتاج إن تستخدم tonumber وتتحقق بـ الي انت تبيه . Link to comment
Mr.Mostafa Posted August 27, 2018 Author Share Posted August 27, 2018 13 minutes ago, Trefeor said: هو راح يرجع لك سلسلة نصية 'string' فـ تحتاج إن تستخدم tonumber وتتحقق بـ الي انت تبيه . يعني كدآ ؟ setTimer( function() local timerMission = convertMilliseconds( getTimerDetails(timer) ) if isTimer(timer) then triggerClientEvent( root, "timeStart2", root, tonumber(timerMission) ) end end, 50, 0 ) Link to comment
Trefeor Posted August 27, 2018 Share Posted August 27, 2018 كذا اقصد addEventHandler("onClientRender", root, function() theTimer = tonumber ( theTimer ) <= 50 and theTimer.." for end" or theTimer dxDrawText(""..theTimer.."", 68 - 1, 414 - 1, 98 - 1, 430 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 + 1, 414 - 1, 98 + 1, 430 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 - 1, 414 + 1, 98 - 1, 430 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 + 1, 414 + 1, 98 + 1, 430 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68, 414, 98, 430, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) end ) هنا لو اقل من او يساوي 50 راح يجيب لك المتبقي وجنبها فور اند واذا عكس التحقق راح يجيب لك المتبقي فقط Link to comment
Mr.Mostafa Posted August 27, 2018 Author Share Posted August 27, 2018 2 minutes ago, Trefeor said: كذا اقصد addEventHandler("onClientRender", root, function() theTimer = tonumber ( theTimer ) <= 50 and theTimer.." for end" or theTimer dxDrawText(""..theTimer.."", 68 - 1, 414 - 1, 98 - 1, 430 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 + 1, 414 - 1, 98 + 1, 430 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 - 1, 414 + 1, 98 - 1, 430 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68 + 1, 414 + 1, 98 + 1, 430 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) dxDrawText(""..theTimer.."", 68, 414, 98, 430, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "bottom", false, false, false, false, false) end ) هنا لو اقل من او يساوي 50 راح يجيب لك المتبقي وجنبها فور اند واذا عكس التحقق راح يجيب لك المتبقي فقط آهآ تمآم , دقيقة بجرب 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