Jump to content

Search the Community

Showing results for tags 'onclientclick'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Member Title


Gang


Location


Occupation


Interests

Found 4 results

  1. local isWindowShowing = false --عشان نعرف الزر ظاهر او لا false متغير بالقيمة local screenW, screenH = guiGetScreenSize() --ذي عشان تجيب احدثيات شاشتك function renderDx() dxDrawRectangle(screenW * 0.2844, screenH * 0.4644, screenW * 0.0919, screenH * 0.0378, tocolor(0, 0, 0, 100), false) --مربع علي شكل زر dxDrawText("تجربة", screenW * 0.2844, screenH * 0.4644, screenW * 0.3762, screenH * 0.5022, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) --داخل المربع كلام end --نقفل الفنكشن function onKey() if isWindowShowing == false then --بمعنى الزر حالياً مخفي false لو المتغير قيمته showCursor(true) --اظهار الماوس isWindowShowing = true --بمعنى الزر ظاهر حالياً true نعطي المتغير قيمه addEventHandler("onClientRender", getRootElement(), renderDx) --نظهر الزر الآن elseif isWindowShowing == true then --بمعنى الزر ظاهر حالياً true لو المتغير قيمته showCursor(false) --نخفى الماوس isWindowShowing = false --بمعنى الزر انحذف الآن false نعطى المتغير قيمه removeEventHandler("onClientRender", getRootElement(), renderDx) --نحذف الزر الآن end --نقفل التحقق end --نقفل الفنكشن bindKey("F9", "down", onKey) --ذا ايفنت من اللعبة انه لما يضغط اف 9 يحصل شئ --// لما يضغط على المربع (الزر) function onClick(theButton, theState) --بين القوسين أحدثيات الرستنقل (المربع) وليس التيكست (الكلام اللى جوا المربع) isMouseInPosition ملاحظه: بتحط تحت فالكود if theButton == "left" and theState == "down" and isWindowShowing == true and isMouseInPosition(screenW * 0.2844, screenH * 0.4644, screenW * 0.0919, screenH * 0.0378) then --لو ضغط كلك يسار فى الماوس واللوحة ظاهره حالياً (بنعرف عن طريق المتغير) والماوس على المربع اللي هو الزر (بنعرف عن طريق احدثيات الشاشة) outputChatBox("تجربة") --نظهر فى الشات تجربة end --نقفل التحقق end --نقفل الفنكشن addEventHandler("onClientClick", getRootElement(), onClick) --ذا ايفنت من اللعبة ان لما الاعب يضغط بالماوس علي الشاشة --// ذا كود جاهز يتحقق من احدثيات الشاشة عشان لما نضغط على المربع (الزر) function isMouseInPosition(x, y, width, height) if not isCursorShowing() then return false end local sx, sy = guiGetScreenSize() local cx, cy = getCursorPosition() local cx, cy = cx * sx, cy * sy if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then return true else return false end end اتمنى الشرح واضح وبسيط للناس الجدد فى برمجة اللغة، يمكنك ايضاً تغيير اظهار فى الشات تجربة إلى اشياء اخرى كثيرة https://wiki.multitheftauto.com/wiki/Main_Page :يمكنك الاطلاع على جميع الفنكشنات حق اللعبة من هنا
  2. The Dra function ClickAllObject( theButton, theState, absoluteX, absoluteY, worldX, worldY, worldZ, clickedWorld ) local playerX, playerY, playerZ = getElementPosition( localPlayer ) local hit, x, y, z, clickedWorld = processLineOfSight ( playerX, playerY, playerZ, worldX, worldY, worldZ ) if hit then outputChatBox(tostring(clickedWorld).." - "..tostring(getElementType(clickedWorld)).." - "..tostring(getElementModel(clickedWorld)) ) if (getElementType(clickedWorld)=="object") and (getElementModel(clickedWorld)==1345) then outputChatBox("true") else outputChatBox("false") end else outputChatBox("false #2") end end addEventHandler( "onClientClick", root, ClickAllObject ) gon كل ما اضغط علي الاوبجكت المقصدود يطلعلي false وما يطلعلي true والله اتمني احد يسداعدني
  3. Olá senhores. Estou querendo evitar o trabalho de mapear milhares de camas e sofás pelos interiores do GTA. Para isso preciso de alguma função que detecte a presença da cama (Objeto com tal ID) próxima ao jogador. Mas todas as funções que tentei não funcionam com objetos nativos do mapa, só com objetos criados por scripts, o que não me adianta nada. Já tentei fazer isso com onClientClick que consegue obter o elemento clicado, mas não funcionou para objetos de cenário. Tentei também getPedTarget, que também só conseguiu obter elementos criados por scripts, não consegue obter elementos de cenário. E por último tentei getPedContactElement, que detecta o elemento que o jogador está em contato, mas novamente não funciona para elementos de cenário. Já até pensei em criar uma esfera de colisão ao redor do jogador para detectar os elementos que estiverem colidindo nela, mas sei que não iria detectar os objetos do cenário. Alguma ideia do que fazer? Ou realmente terei que fazer manualmente 1 por 1?
  4. i created a dx panel, and i created some onClientClick event for this panel. but when i hide the panel, the onClientClick events are working.. how to fix this?
×
×
  • Create New...