Jump to content

ALGUEM ME AJUDA PFV


Recommended Posts

Então eu tentei fazer um painel dx de pega skin etc só que quando eu vou dar o comando n vai alguem consegue me ajudar 

 

 
Quote

pode deixar ja arrumei obs:( n sei exluir isso)

 
Edited by JPzin
Link to comment

quer dizer resolvi n só foi um mal entendido então meu codigo n sei oq ta de errado nele

 

 
local screenW, screenH = guiGetScreenSize()

local exibir = false
 function paineldx ()
    dxDrawRectangle(388, 318, 701, 462, tocolor(45, 45, 45, 255), false)
    dxDrawRectangle(388, 317, 701, 17, tocolor(14, 214, 250, 255), false)

    dxDrawRectangle(398, 369, 241, 103, tocolor(30, 30, 30, 255), false)
    dxDrawRectangle(400, 487, 241, 103, tocolor(30, 30, 30, 255), false)
    dxDrawRectangle(398, 627, 241, 103, tocolor(30, 30, 30, 255), false)
    dxDrawRectangle(688, 364, 241, 103, tocolor(30, 30, 30, 255), false)
    dxDrawRectangle(688, 487, 241, 103, tocolor(30, 30, 30, 255), false)
    dxDrawRectangle(688, 627, 241, 103, tocolor(30, 30, 30, 255), false)
    dxDrawText("M4", 455, 374, 672, 452, tocolor(255, 255, 255, 255), 3.00, "pricedown", "left", "top", false, false, false, false, false)
    dxDrawText("AK-47", 424, 497, 641, 575, tocolor(255, 255, 255, 255), 3.00, "pricedown", "left", "top", false, false, false, false, false)
    dxDrawText("Glock", 414, 637, 631, 715, tocolor(255, 255, 255, 255), 3.00, "pricedown", "left", "top", false, false, false, false, false)
    dxDrawText("Skin 1", 717, 374, 934, 452, tocolor(255, 255, 255, 255), 3.00, "pricedown", "left", "top", false, false, false, false, false)
    dxDrawText("Skin 2", 717, 493, 934, 571, tocolor(255, 255, 255, 255), 3.00, "pricedown", "left", "top", false, false, false, false, false)
    dxDrawText("Veiculo", 722, 652, 939, 730, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false)
    dxDrawText("Guardião Roleplay", 528, 334, 1014, 360, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false)
end

addCommandHandler("corp", function()
     if exibir == false then
       addEventHandler("onClientRender", getRootElement(), paineldx)    
    exibir = true
    showCursor(true)
else
   removeEventHandler("onClientRender", getRootElement(), paineldx)
        exibir = false
        showCursor(false)
     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

-- Modified version for DX Text
function isCursorOverText(posX, posY, sizeX, sizeY)
   if ( not isCursorShowing( ) ) then
      return false
   end
   local cX, cY = getCursorPosition()
   local screenWidth, screenHeight = guiGetScreenSize()
   local cX, cY = (cX*screenWidth), (cY*screenHeight)

   return ( (cX >= posX and cX <= posX+(sizeX - posX)) and (cY >= posY and cY <= posY+(sizeY - posY)) )
end

addEventHandler("onClientClick", getRootElement(), function(button, state)
    if button=="left" and state=="down" then
        if exibir == true then
      if isMouseInPosition(398, 369, 241, 103,) then
           givePlayerMoney(10000)
      end        
    end
end)

 

 

 












 
Link to comment
  • Other Languages Moderators

Não crie diversos tópicos com assuntos parecidos.

Irei fechar este tópico. Caso ainda precise de ajuda neste painel, continue no outro post sobre o outro painel DX.

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...