Firespider Posted August 16, 2022 Share Posted August 16, 2022 When I click on it, nothing happens local Gun = createPed(312, 296.15252685547, -40.215438842773, 1001.515625) setElementInterior(Gun, 1) -------------------------------------- local sx,sy = guiGetScreenSize();--1920,1080 local relx,rely = sx/1920,sy/1080; local isCardShop = true color = tocolor(41, 173, 21, 255) color1 = tocolor(41, 173, 21, 200) addEventHandler("onClientRender", root, function() showCursor(true) if (isCardShop) then dxDrawRectangle(sx*.35, sy*.20, sx*.35, sy*.05, tocolor(110, 118, 125, 255))--Fejléc dxDrawText("Fegyver bolt", sx*.55, sy*.2, sx*.49, sy*.25, tocolor(200, 200, 200, 255), relx*2, rely*2, "default-bold", "center", "center", false, false, false)--Felirat dxDrawRectangle(sx*.35, sy*.25, sx*.35, sy*.5, tocolor(0, 0, 0, 200))--Fejléc dxDrawText("Colt-45", sx*.40, sy*.31, sx*.35, sy*.25, tocolor(200, 200, 200, 255), relx*2, rely*2, "default-bold", "center", "center", false, false, false)--Felirat dxDrawText("50.000$", sx*.40, sy*.35, sx*.35, sy*.25, tocolor(69, 194, 58, 255), relx*2, rely*2, "default-bold", "center", "center", false, false, false)--Felirat if isMouseInPosition(sx*.41, sy*.25, sx*.10, sy*.06) then dxDrawRectangle(sx*.41, sy*.25, sx*.10, sy*.06, color)--gomb dxDrawText("Megvétel", sx*.57, sy*.32, sx*.35, sy*.25, tocolor(200, 200, 200, 255), relx*2, rely*2, "default-bold", "center", "center", false, false, false)--Felirat else dxDrawRectangle(sx*.41, sy*.25, sx*.10, sy*.06, color1)--gomb dxDrawText("Megvétel", sx*.57, sy*.32, sx*.35, sy*.25, tocolor(200, 200, 200, 200), relx*2, rely*2, "default-bold", "center", "center", false, false, false)--Felirat end end end ); -------------------------------------------------- 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 ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end function OpenWindow() IsCardShop = not IsCardShop if removeEventHandler("onClientRender", root, Panel) then removeEventHandler("onClientRender", root, Panel) showCursor(false) else addEventHandler("onClientRender", root, Panel) showCursor(true) end end bindKey("F3", "down", OpenWindow) ---------- addEventHandler("onClientClick", root, function(button,state) if IsCardShop == true then if ( button == "left" and state == "down" ) then if isMouseInPosition(.41, sy*.25, sx*.10, sy*.06) then local yourMoney = getPlayerMoney() if ( yourMoney >= 10000) then takePlayerMoney(10000) else outputChatBox("Nincs elég pénzed",255,0,0,true) --outputChatBox("Menj be a Markerbe a vizsga elkezdéséhez") end end end end end) Link to comment
#\_oskar_/# Posted August 16, 2022 Share Posted August 16, 2022 This is the error replace it if isMouseInPosition(sx*.41, sy*.25, sx*.10, sy*.06) then Link to comment
Firespider Posted August 16, 2022 Author Share Posted August 16, 2022 Doesn't working. 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