Leaderboard
Popular Content
Showing content with the highest reputation on 16/01/21 in Posts
-
pAttach Optimized bone attach thanks to the new MTA functions/events. This resource doesn't match with well known bone_attach, you can not use the same parameters! Documentation moved to GitHub! Go to GitHub...2 points
-
For dxDrawImage3D you need to put faceTowardX/Y/Z argument too if you want to rotate image on the ground.1 point
-
Thank you very much @Simple0x47 helped me a lot!1 point
-
1 point
-
1 point
-
local aba = "inicio" function render() if aba == "inicio" then [...] elseif aba == "player" then [...] end end function onClick(button, state) if isCursorOnElement(...) then aba = "player" end end addEventHandler("onClientClick", root, onClick) Aí um pequeno exemplo. Basicamente, você vai usar uma variável para guardar a página do painel que o player está atualmente, e fazer a mudança dela de acordo de onde o player clica, e no onClientRender basta usar um if para ver em qual página está, e dependendo da página é exibido um layout diferente no painel DX.1 point
-
1 point
-
Thanks for help but finally i made a function which renew xml from file always when player is starting client resource, thanks one more time. /to close1 point
-
Well... You've got a variable _nowY which holds: sy - 305 - (47 * 1) But, you use that value hardcoded into the assignment of the pos variable: pos = {interpolateBetween(20 - 80, sy - 305 - (47 * 1), 0, 20, sy - 305 - (47 * 1)... pos = {interpolateBetween(20, sy - 305 - (47 * 1), 0, 20, sy - 305 - (47 * 1)... That's not all! At the end you update the variable nowY, which is not being used anywhere. I'd say you get a grasp of the basics of variables. All that being said, what you must do is make usage of the variable nowY, which must be defined before the start of the for loop, so you have an assigned value for the first notification which will be shown, but for that you must make usage of the variable nowY within those interpolateBetween, so pos may hold an Y value which changes depending on the number of the notification. All that being translated into code results into this: --client function drawnBoxes() _sx, _sy = sx, sy nowY = sy - 305 - (47 * 1) local now = getTickCount() for k,v in ipairs(cache) do local msg = v["msg"] local length = v["length"] local startTime = v["now"] local endTime = v["end"] local state = v["state"] local type = v["type"] local tick = v["tick"] local showtime = v["showtime"] or 8000 local customProg = v["customProg"] local boxSize = 25 local pos, alpha -- = v["pos"], v["alpha"] local r,g,b = unpack(types[type][2]) if not r or not g or not b then getColors(true) end local icon = types[type][1] local timeLine = false local timeLineProg if state == "fadeIn" then local elapsedTime = now - startTime local duration = endTime - startTime local progress = elapsedTime / duration if progress < 1 then pos = {interpolateBetween(20 - 80, nowY, 0, 20, nowY, 0, progress, 'OutQuad')} alpha = {interpolateBetween(0,0,0, 220,255,0, progress, 'OutQuad')} else alpha = {220, 255, 0} pos = {20, nowY, 0} cache[k]["now"] = getTickCount() cache[k]["end"] = getTickCount() + showtime cache[k]["state"] = "timeLineStart" end elseif state == "timeLineStart" then alpha = {220, 255, 0} pos = {20, nowY, 0} local elapsedTime = now - startTime local duration = endTime - startTime local progress = elapsedTime / duration if customProg and customProg[1] and customProg[2] then progress = customProg[2] / customProg[1] -- now / max end timeLine = true timeLineProg = progress if progress >= 1 then cache[k]["now"] = getTickCount() cache[k]["end"] = getTickCount() + 1600 cache[k]["state"] = "fadeOut" end elseif state == "fadeOut" then timeLine = true local now = getTickCount() local elapsedTime = now - startTime local duration = endTime - startTime local progress = elapsedTime / duration pos = {interpolateBetween(20, nowY, 0, 20, nowY, 0, progress, 'OutQuad')} alpha = {interpolateBetween(220, 255,0, 0,0,0, progress, 'OutQuad')} if progress >= 0.95 then table.remove(cache, k) if #cache <= 0 then if renderState then renderState = false --removeEventHandler("onClientRender", root, drawnBoxes) destroyRender("drawnBoxes") end end end end local boxWidth = length + 70 dxDrawRectangle(pos[1], pos[2], boxWidth, 50, tocolor(22, 22, 22, alpha[1]),true) dxDrawText(msg, pos[1] + 55 + 10, pos[2] + 26, 0, 0, tocolor(156, 156, 156, alpha[2]), 0.75, notificationFont, 'left', 'top',false,false,true,true,false) dxDrawText(details[type][1], pos[1] + 55 + 10, pos[2] + 10, 0, 0, tocolor(255, 255, 255, alpha[2]), 0.75, notificationFontBold, 'left', 'top',false,false,true,false,false) dxDrawImage(pos[1] + 10, pos[2] + 10, 30, 30, 'files/notificationIcons/'..details[type][2]..'.png', 0,0,0, tocolor(r, g, b, alpha[2]),true) if timeLine then timeLineSize = interpolateBetween(boxWidth, 0,0, 0, 0,0, timeLineProg or 1, customProg and "Linear" or 'OutQuad') else timeLineSize = boxWidth end dxDrawRectangle(pos[1], pos[2] + 48, timeLineSize, 2, tocolor(r, g, b, alpha[2]),true) nowY = nowY + 35 end end This code will make notifications get out of the screen after certain number of notifications, so you should create certain notification's queue in order to make the excess appear after the first ones are gone.1 point
-
تعديل بسيط انا مخلص html css وهما لغات مش برمجة وفعلا زى ماقولت سهلين وعرفت من الشخص بعد ردك ان لازم يكون عندى فكرة فيهم قبل مااتعلم استخدام وردب بريس والحمدلله عندى فكرة1 point
-
You can read xml from a string. So you got your xml tree scoped by your own script. https://wiki.multitheftauto.com/wiki/XmlLoadString But keep in mind that there is no MTA function yet to convert it back to a string. (unless you make one yourself)1 point
-
php = ما راح تحتاجلها كثير اذا كنت بتطور موقع او شئ من هذا المثيل, طبعا الخاصيه هذي تقدر تسخدمها في اشياء خاصه بها, تقدر تشوفها على اليوتيوب, javascript = يستخدم لصنع تأثيرات في الموقع , html css = لغة البرمجه الخاصه بالمواقع, وهي تعتبر من اسهل اللغات بالنسبه لي , اي شئ مافهمته علمني ومابقصر معكـ1 point
-
1 point
-
Just some format examples, the right format depends on how you work with them: itemProperties = { ["water"] = { ["friendlyName"] = "Water" }, ["sandwitch"] = { ["friendlyName"] = "Sandwitch" } } items = { ["water"] = {-- Item 1 ["amount"] = 2 }, ["sandwitch"] = {-- Item 2 ["amount"] = 1 }, } -- or items = { {-- Item 1 ["amount"] = 2, ["id"] = "water" }, {-- Item 2 ["amount"] = 1, ["id"] = "sandwitch" }, } combine_list = { { ["ingredients"] = { ["water"] = 2, -- 2x water ["sandwitch"] = 1, -- 1x sandwitch }, ["newItem"] = "water sandwitch" }--[[, { -- next combination ["ingredients"] = { ["water"] = 2, -- 2x water ["sandwitch"] = 1, -- 1x sandwitch }, ["newItem"] = "water sandwitch" }]] }1 point
-
Você pode começar a partir do exemplo desta página: https://wiki.multitheftauto.com/wiki/FadeInText1 point
