Search the Community
Showing results for tags 'dx drawing'.
-
Hello, I am creating a simple script to show a DX rectangle and text when a player hits a marker, it is for a vehicle system but I can do all but keep the DX box showing. It flashes up when you hit the marker then it just vanishes... I don't know why and I am struggling to understand why it just stays for a second then goes away, the code is below. Server --Make the markers CarSpawn = createMarker (1682.8740234375, -2326.5634765625, 12.5, "cylinder", 1.5, 0, 50, 150, 200) --When the player hits the marker trigger an event to create a GUI function FreeCars (hitElement, matchingDimension) if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension and isPedOnGround ( hitElement ) then triggerClientEvent("showfreecar", hitElement)--This shows, then vanishes... else outputChatBox("You need to be on foot", hitElement, 230, 102, 103) end end addEventHandler("onMarkerHit", CarSpawn, FreeCars) --still to make all the spawn stuff and system to check spawned vehicles, but this is relatively easy. Client function FreeCarGUI() dxDrawLine(307 - 1, 458 - 1, 307 - 1, 590, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(493, 458 - 1, 307 - 1, 458 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(307 - 1, 590, 493, 590, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(493, 590, 493, 458 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(307, 458, 186, 132, tocolor(12, 49, 206, 152), false) dxDrawText("1. Sanchez", 323 - 1, 473 - 1, 476 - 1, 510 - 1, tocolor(234, 242, 18, 111), 2.50, "default", "left", "top", false, false, false, false, false) dxDrawText("1. Sanchez", 323 + 1, 473 - 1, 476 + 1, 510 - 1, tocolor(234, 242, 18, 111), 2.50, "default", "left", "top", false, false, false, false, false) dxDrawText("1. Sanchez", 323 - 1, 473 + 1, 476 - 1, 510 + 1, tocolor(234, 242, 18, 111), 2.50, "default", "left", "top", false, false, false, false, false) dxDrawText("1. Sanchez", 323 + 1, 473 + 1, 476 + 1, 510 + 1, tocolor(234, 242, 18, 111), 2.50, "default", "left", "top", false, false, false, false, false) dxDrawText("1. Sanchez", 323, 473, 476, 510, tocolor(0, 0, 0, 172), 2.50, "default", "left", "top", false, false, false, false, false) end addEvent("showfreecar", true) addEventHandler("showfreecar", root, FreeCarGUI) Thank you for any help. I used Remp's GUI editor for this, I am very bad with DX elements.