Jump to content

FlyingSpoon

Members
  • Posts

    749
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by FlyingSpoon

  1. Yeah but if I name the variable to, menuState = false No such thing exists so what's the point of it ?
  2. Hi I visited many servers, and I see awesome login panel's made from Dx, Help Panels and other awesome things that contain Dx. I really want to learn Dx, but I am struggling, I looked at the wiki a lot of times and the only problem is I don't know how to create a Dx like a GUI. For example, A Dx with Dx buttons which function and the Dx window binded to F1. Please? Can anyone help me ?
  3. Thank you @borjahen for letting me know that my TUT helped you
  4. So, function menuState() local DxMenu = false To that?
  5. I don't understand, what do you mean? function DxMenu to function DxMenuTwo ? But that's the whole window thing isn't it?
  6. Here's the error, function cmdType() addEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(true) DxMenu = true end addCommandHandler("settingsmenu", cmdType)
  7. Don't work, now the Dx don't appear.
  8. Like this? ----------------------- -- The Menu -- ----------------------- function DxMenu() font = dxCreateFont("Digital.ttf",30) dxDrawRectangle(261, 125, 292, 287, tocolor(50, 160, 212, 144), false) dxDrawRectangle(312, 196, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 197, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawLine(261, 170, 552, 170, tocolor(1, 1, 1, 219), 1, true) dxDrawRectangle(312, 255, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 256, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawRectangle(312, 316, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 317, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawRectangle(481, 380, 70, 29, tocolor(0, 0, 0, 255), false) dxDrawRectangle(482, 381, 68, 27, tocolor(50, 160, 212, 255), false) gameSet = dxDrawText("Game Settings", 359, 269, 431, 287, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Help Menu", 371, 210, 443, 228, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Coming Soon...", 359, 329, 431, 347, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) closeBtn = dxDrawText("Close", 498, 386, 534, 400, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Settings Menu", 335, 128, 434, 155, tocolor(0, 0, 0, 255), 1.00, font, "left", "top", false, false, true, false, false) end ----------------------- ----------------------- -- Menu Moved -- ----------------------- function bindKeys() bindKey("F1", "down", F1RPhelp) end addEventHandler("onClientResourceStart", getRootElement(), bindKeys) function resetState() pressed = false end function F1RPhelp() outputChatBox("This menu has been moved to /settingsmenu!", 0, 179, 255) DxMenu = true end ---------------------- ---------------------- -- Binded CMD -- ---------------------- function cmdType() addEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(true) end addCommandHandler("settingsmenu", cmdType) ---------------------- ---------------------- -- Test -- ---------------------- function bTest() tWindow = guiCreateWindow(233, 251, 297, 226, "", false) guiWindowSetSizable(tWindow, false) end local DxMenu = false ----------------------- -- Clicks -- ----------------------- function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) -- Get the player screen resolution local cx, cy = getCursorPosition ( ) -- Get the cursor position local cx, cy = ( cx * sx ), ( cy * sy ) -- Convert relative positions to absolute if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end addEventHandler ( "onClientClick", root, function ( ) if ( DxMenu ) then if isMouseInPosition ( 481, 380, 70, 29 ) then outputChatBox("Hi") removeEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(false) end end end ) ------------------------- local DxMenu = false DxMenu = true
  9. One question, why shall I put it in F1RPhelp?
  10. Is it done like this? addEventHandler ( "onClientClick", root, function ( ) if DxMenu then if isMouseInPosition ( 481, 380, 70, 29 ) then removeEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(false) end end end )
  11. Well can you give me an example, I don't understand this I feel embarrassed.
  12. This example? But when I click there for example a player click by accident, then the GUI will appear.
  13. Because once I click Game Settings, I want a GUI to appear. gameSet = dxDrawText("Game Settings", 359, 269, 431, 287, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false)
  14. function bTest() tWindow = guiCreateWindow(233, 251, 297, 226, "", false) guiWindowSetSizable(tWindow, false) end ----------------------- -- The Menu -- ----------------------- function DxMenu() font = dxCreateFont("Digital.ttf",30) dxDrawRectangle(261, 125, 292, 287, tocolor(50, 160, 212, 144), false) dxDrawRectangle(312, 196, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 197, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawLine(261, 170, 552, 170, tocolor(1, 1, 1, 219), 1, true) dxDrawRectangle(312, 255, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 256, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawRectangle(312, 316, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 317, 184, 41, tocolor(50, 160, 212, 255), false) closeBtn = dxDrawRectangle(481, 380, 70, 29, tocolor(0, 0, 0, 255), false) dxDrawRectangle(482, 381, 68, 27, tocolor(50, 160, 212, 255), false) gameSet = dxDrawText("Game Settings", 359, 269, 431, 287, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Help Menu", 371, 210, 443, 228, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Coming Soon...", 359, 329, 431, 347, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Close", 498, 386, 534, 400, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Settings Menu", 335, 128, 434, 155, tocolor(0, 0, 0, 255), 1.00, font, "left", "top", false, false, true, false, false) end ----------------------- ----------------------- -- Menu Moved -- ----------------------- function bindKeys() bindKey("F1", "down", F1RPhelp) end addEventHandler("onClientResourceStart", getRootElement(), bindKeys) function resetState() pressed = false end function F1RPhelp() outputChatBox("This menu has been moved to /settingsmenu!", 0, 179, 255) end ---------------------- ---------------------- -- Binded CMD -- ---------------------- function cmdType() addEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(true) end addCommandHandler("settingsmenu", cmdType) ---------------------- ----------------------- -- Clicks -- ----------------------- function allClicks() if source == closeBtn then removeEventHandler("onClientRender", getRootElement(), DxMenu) end end addEventHandler("onClientGUIClick", getRootElement(), allClicks) ----------------------- Here's an example, so what would I do next? function clickIt() if source == gameSet then guiSetVisible(tWindow, true)
  15. I am a noob in scripting, can you help me out I am seriously stuck
  16. What do you mean? So if I click game settings dx, how can I make a GUI appear?
  17. It works fine, but imagine I want to click there to open up a GUI, even if the gui is off and by accident a player clicks there it will open up the gui that's not good What then?
  18. Can you give me an example or show me how it's done. I am new to Dx and I want to learn it really badly for personal uses
  19. ----------------------- -- The Menu -- ----------------------- function DxMenu() font = dxCreateFont("Digital.ttf",30) dxDrawRectangle(261, 125, 292, 287, tocolor(50, 160, 212, 144), false) dxDrawRectangle(312, 196, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 197, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawLine(261, 170, 552, 170, tocolor(1, 1, 1, 219), 1, true) dxDrawRectangle(312, 255, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 256, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawRectangle(312, 316, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 317, 184, 41, tocolor(50, 160, 212, 255), false) closeBtn = dxDrawRectangle(481, 380, 70, 29, tocolor(0, 0, 0, 255), false) dxDrawRectangle(482, 381, 68, 27, tocolor(50, 160, 212, 255), false) dxDrawText("Game Settings", 359, 269, 431, 287, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Help Menu", 371, 210, 443, 228, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Coming Soon...", 359, 329, 431, 347, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Close", 498, 386, 534, 400, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Settings Menu", 335, 128, 434, 155, tocolor(0, 0, 0, 255), 1.00, font, "left", "top", false, false, true, false, false) end ----------------------- ----------------------- -- Menu Moved -- ----------------------- function bindKeys() bindKey("F1", "down", F1RPhelp) end addEventHandler("onClientResourceStart", getRootElement(), bindKeys) function resetState() pressed = false end function F1RPhelp() outputChatBox("This menu has been moved to /settingsmenu!", 0, 179, 255) end ---------------------- ---------------------- -- Binded CMD -- ---------------------- function cmdType() addEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(true) end addCommandHandler("settingsmenu", cmdType) ---------------------- ----------------------- -- Clicks -- ----------------------- function allClicks() if source == closeBtn then removeEventHandler("onClientRender", getRootElement(), DxMenu) end end addEventHandler("onClientGUIClick", getRootElement(), allClicks) ----------------------- I am trying to create a simple script, but when I press that DxRectangle the DxMenu doesn't close or dissapear ! Please help it's urgent please!
  20. Hi, I would like to create a few scripts, possibly a job script or a panel. Well I asked a few friends, and half suggested Dx and the other half suggested GUI. Which is better to work with?
  21. No sir, we don't. As we are a private hosting, we don't have a website. We only deal privately.
  22. We sold our first 2 gameservers, Interested in buying one? Just leave me a message and I will get to you as soon as possible! [ MTA:SA - $0.05 ]
  23. Admin, thanks for changing my image to a dog
  24. Sure no, problem. Test Server: mtasa://62.210.214.12:22003
×
×
  • Create New...