-
Posts
111 -
Joined
-
Last visited
-
Days Won
1
Everything posted by beast99
-
Poderia ajudar lord?
-
Lord, consegui , mas quero fazer um "X" para fechar o painel, segue o código: local monitorSize = {guiGetScreenSize()} local panelSize = {330, 550} local panelX, panelY = monitorSize[1]/2-panelSize[1]/2, monitorSize[2]/2-panelSize[2]/2 local buttonSize = {320, 25} local render = false local font = dxCreateFont("font.ttf", 14) theMarker = createMarker(2796.071, -2373.505, 13.631, "cylinder", 1) function markerPanel(hitPlayer, matchingdimension) if (hitPlayer == localPlayer) then addEventHandler("onClientRender", root, renderPanel) render = true showCursor(true) end end addEventHandler ("onClientMarkerHit", theMarker, markerPanel) function renderPanel() dxDrawText("Shop #1c86eeArmas", panelX+panelSize[1]/2, panelY+10, panelX+panelSize[1]/2, panelY+10, tocolor(255, 255, 255, 255), 0.7, font, "center", "center", false, false, true, true) dxDrawRectangle(panelX, panelY, panelSize[1], panelSize[2]+50, tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX, panelY, panelSize[1], 20, tocolor(0, 0, 0, 150)) for i, v in ipairs(guns) do if isInBox(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2]) then dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(28, 134, 238, 200)) else dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(0, 0, 0, 100)) end dxDrawText(v[1], panelX+15, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) dxDrawText("Comprar", panelX+235, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) end end function panelClick( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button == "left" and state == "down" and render then for i, v in ipairs(guns) do if dobozbaVan(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], absoluteX, absoluteY) then triggerServerEvent("buyWeapon", localPlayer, localPlayer, v[1], v[2], v[3], v[4]) end end end end addEventHandler ("onClientClick", getRootElement(), panelClick ) function dobozbaVan(dX, dY, dSZ, dM, eX, eY) if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then return true else return false end end function isInBox(xS,yS,wS,hS) if(isCursorShowing()) then XY = {guiGetScreenSize()} local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*XY[1], cursorY*XY[2] if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false end end end
-
Lord, quero colocar o painel e o marker para apenas 1 acl conseguir observar, teria como me ajudar?
-
Bom dia Lord, fiz isso, apareceu o marker mas o painel não, segue o código: local monitorSize = {guiGetScreenSize()} local panelSize = {330, 550} local panelX, panelY = monitorSize[1]/2-panelSize[1]/2, monitorSize[2]/2-panelSize[2]/2 local buttonSize = {320, 25} local render = false local font = dxCreateFont("font.ttf", 14) theMarker = createMarker(2796.071, -2373.505, 13.631, "cylinder", 1) function markerPanel(hitPlayer, matchingdimension) if (hitplayer == localPlayer) then addEventHandler("onClientRender", root, renderPanel) render = true showCursor(true) end end function togPanel(button, press) if button=="F2" and press and not render then addEventHandler("onClientRender", root, renderPanel) render = true showCursor(true) elseif button=="F2" and press and render then removeEventHandler("onClientRender", root, renderPanel) render = false showCursor(false) end end addEventHandler("onClientKey", root, togPanel) function renderPanel() dxDrawText("Shop #1c86eeArmas", panelX+panelSize[1]/2, panelY+10, panelX+panelSize[1]/2, panelY+10, tocolor(255, 255, 255, 255), 0.7, font, "center", "center", false, false, true, true) dxDrawRectangle(panelX, panelY, panelSize[1], panelSize[2]+50, tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX, panelY, panelSize[1], 20, tocolor(0, 0, 0, 150)) for i, v in ipairs(guns) do if isInBox(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2]) then dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(28, 134, 238, 200)) else dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(0, 0, 0, 100)) end dxDrawText(v[1], panelX+15, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) dxDrawText("Comprar", panelX+235, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) end end function panelClick( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button == "left" and state == "down" and render then for i, v in ipairs(guns) do if dobozbaVan(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], absoluteX, absoluteY) then triggerServerEvent("buyWeapon", localPlayer, localPlayer, v[1], v[2], v[3], v[4]) end end end end addEventHandler ("onClientClick", getRootElement(), panelClick ) function dobozbaVan(dX, dY, dSZ, dM, eX, eY) if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then return true else return false end end function isInBox(xS,yS,wS,hS) if(isCursorShowing()) then XY = {guiGetScreenSize()} local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*XY[1], cursorY*XY[2] if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false end end end Debug script não dá nenhum erro, o que pode ser?
-
https://imgur.com/a/bCR5cKC Print do erro com o debug script, código está assim: local monitorSize = {guiGetScreenSize()} local panelSize = {330, 550} local panelX, panelY = monitorSize[1]/2-panelSize[1]/2, monitorSize[2]/2-panelSize[2]/2 local buttonSize = {320, 25} local render = false local font = dxCreateFont("font.ttf", 14) theMarker = createMarker (2796.071, -2373.505, 13.631, "cylinder", 1) function markerPanel (hitPlayer, matchingDimension) if (hitPlayer == localPlayer) then addEventHandler("onClientRender", root, renderPanel) render = true showCursor(true) end end addEventHandler ("onClientMarkerHit", theMarker, markerPanel) function togPanel(button, press) if button=="F2" and press and not render then addEventHandler("onClientRender", root, renderPanel) render = true showCursor(true) elseif button=="F2" and press and render then removeEventHandler("onClientRender", root, renderPanel) render = false showCursor(false) end end addEventHandler("onClientKey", root, togPanel) function renderPanel() dxDrawText("Shop #1c86eeArmas", panelX+panelSize[1]/2, panelY+10, panelX+panelSize[1]/2, panelY+10, tocolor(255, 255, 255, 255), 0.7, font, "center", "center", false, false, true, true) dxDrawRectangle(panelX, panelY, panelSize[1], panelSize[2]+50, tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX, panelY, panelSize[1], 20, tocolor(0, 0, 0, 150)) for i, v in ipairs(guns) do if isInBox(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2]) then dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(28, 134, 238, 200)) else dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(0, 0, 0, 100)) end dxDrawText(v[1], panelX+15, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) dxDrawText("Comprar", panelX+235, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) end end function panelClick( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button == "left" and state == "down" and render then for i, v in ipairs(guns) do if dobozbaVan(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], absoluteX, absoluteY) then triggerServerEvent("buyWeapon", localPlayer, localPlayer, v[1], v[2], v[3], v[4]) end end end end addEventHandler ("onClientClick", getRootElement(), panelClick ) function dobozbaVan(dX, dY, dSZ, dM, eX, eY) if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then return true else return false end end function isInBox(xS,yS,wS,hS) if(isCursorShowing()) then XY = {guiGetScreenSize()} local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*XY[1], cursorY*XY[2] if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false end end end
-
Lord, agora estou com um problema, coloquei no .client e agora nem no bindKey e nem no marker aparece nada, poderia ajudar?
-
Boa Tarde, estava fazendo uma script para meu servidor, e tentei fazer o seguinte. Queria que aparecesse o painel no marker, mas ele não aparece, conseguir colocar bindKey no F2 mas pelo marker não consigo, alguem pode ajudar? Client: local monitorSize = {guiGetScreenSize()} local panelSize = {330, 550} local panelX, panelY = monitorSize[1]/2-panelSize[1]/2, monitorSize[2]/2-panelSize[2]/2 local buttonSize = {320, 25} local render = false local font = dxCreateFont("font.ttf", 14) function togPanel(button, press) if button=="F2" and press and not render then addEventHandler("onClientRender", root, renderPanel) render = true showCursor(true) elseif button=="F2" and press and render then removeEventHandler("onClientRender", root, renderPanel) render = false showCursor(false) end end addEventHandler("onClientKey", root, togPanel) function renderPanel() dxDrawText("Shop #1c86eeArmas", panelX+panelSize[1]/2, panelY+10, panelX+panelSize[1]/2, panelY+10, tocolor(255, 255, 255, 255), 0.7, font, "center", "center", false, false, true, true) dxDrawRectangle(panelX, panelY, panelSize[1], panelSize[2]+50, tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX, panelY, panelSize[1], 20, tocolor(0, 0, 0, 150)) for i, v in ipairs(guns) do if isInBox(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2]) then dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(28, 134, 238, 200)) else dxDrawRectangle(panelX+5, panelY+30+((i-1)*30), buttonSize[1], buttonSize[2], tocolor(0, 0, 0, 150)) dxDrawRectangle(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], tocolor(0, 0, 0, 100)) end dxDrawText(v[1], panelX+15, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) dxDrawText("Comprar", panelX+235, panelY-60+((i-1)*30), panelX+35+buttonSize[1]/2,panelY+130+((i-1)*30)+15, tocolor(255, 255, 255, 255), 0.9, font, "left", "center", false, false, true, true) end end function panelClick( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button == "left" and state == "down" and render then for i, v in ipairs(guns) do if dobozbaVan(panelX+210, panelY+30+((i-1)*30), buttonSize[1]/2.8, buttonSize[2], absoluteX, absoluteY) then triggerServerEvent("buyWeapon", localPlayer, localPlayer, v[1], v[2], v[3], v[4]) end end end end addEventHandler ("onClientClick", getRootElement(), panelClick ) function dobozbaVan(dX, dY, dSZ, dM, eX, eY) if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then return true else return false end end function isInBox(xS,yS,wS,hS) if(isCursorShowing()) then XY = {guiGetScreenSize()} local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*XY[1], cursorY*XY[2] if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false end end end Server: addEvent("buyWeapon", true) addEventHandler("buyWeapon", root, function(thePlayer, name, gunid, price, ammo) if getPlayerMoney(thePlayer)>=price then giveWeapon(thePlayer, gunid, ammo, true) outputChatBox("#1c86ee[SERVER] #FFFFFF Você comprou com sucesso #1c86eeR$ #FFFFFF" .. price, thePlayer, 255, 255, 255, true) else outputChatBox("#1c86ee[SERVER] #FFFFFF Você não tem dinheiro suficiente", thePlayer, 255, 255, 255, true) end end) Shared: guns = { --Name, id, price, ammo {"Colt 45", 22, 2000, 17}, {"Silenced", 23, 3000, 17}, {"Deagle", 24, 4000, 7}, {"Shotgun", 25, 6000, 10}, {"Sawed-off", 26, 6500, 20}, {"Combat shotgun", 27, 8000, 7}, {"Uzi", 28, 10000, 50}, {"Tec9", 32, 12000, 30}, {"MP5", 29, 20000, 50}, {"AK47", 30, 25000, 30}, {"M4", 30, 25000, 50}, {"Rifle", 33, 30000, 10}, {"Sniper", 34, 35000, 10}, } Observação: O marker deve se localizar na seguinte localização: 2796.0712890625,-2373.5051269531,13.631641387939. Obrigado a Todos que poderem ajudar.
-
Sim sim. Está ai o link dela: https://imgur.com/a/0c5Bt71 No seu script, o painel apenas fica pouco tempo aberto, eu queria que ele ficasse infinitamente..
-
Como poderia fazer isso? Tenho o gosto de aprender.
-
não tinha reparado, sou novo aqui no forum como pode ver. Client_Side: local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) function AbrirDied () dxDrawImage(x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent ( "OpenPainel", true) addEventHandler ( "OpenPainel", root, AbrirDied ) Server_Side: addEventHandler( "onPlayerWasted", getRootElement() ), function spawnls() setTimer( spawnPlayer, 2000, 1, source, 2035.90332, -1413.13599, 16.99219, 0, 0, 90} ) triggerClientEvent ( source, "AirNew>AbrirAgencia", root) end agora está correto, desculpe pelo incomodo.
-
Peço desculpa por não ter usado o [Lua] Agora vai corretamente: Client_Side: [Lua]local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) function AbrirDied () dxDrawImage(x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent ( "OpenPainel", true) addEventHandler ( "OpenPainel", root, AbrirDied )[/Lua] Server_Side: [Lua]addEventHandler( "onPlayerWasted", getRootElement() ), function spawnls() setTimer( spawnPlayer, 2000, 1, source, 2035.90332, -1413.13599, 16.99219, 0, 0, 90} ) triggerClientEvent ( source, "AirNew>AbrirAgencia", root) end [/Lua]
-
Bom Dia, estou tentando fazer um script, que quando o jogador morre, le apareça um painel DX, para poder selecionar o local de spawn, contudo, não consigo que o painel apareça, alguem me consegue ajudar? Código abaixo: PS: sou noob, não levem a sério minha programação, estou nas primeiras semanas de programação. Client_Side: local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) function AbrirDied () dxDrawImage(x*0, y*0, x*1366, y*768, "files/img/fundo2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent ( "OpenPainel", true) addEventHandler ( "OpenPainel", root, AbrirDied ) Server_Side: addEventHandler( "onPlayerWasted", getRootElement() ), function spawnls() setTimer( spawnPlayer, 2000, 1, source, 2035.90332, -1413.13599, 16.99219, 0, 0, 90} ) triggerClientEvent ( source, "AirNew>AbrirAgencia", root) end