Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 16/04/24 in all areas

  1. @JPzin deixa o like nas respostas, já que eu fiz o resource inteiro pra vc kkkkkkkk
    1 point
  2. Desta forma: Client-side: local screenW, screenH = guiGetScreenSize() local painel = false -- Layout Fixo: (centralizado) local layout = { -- posX, posY, sizeX, sizeY, colorRGBA, text, textColorRGBA, fontSize, fontFamily, alignX, alignY {-320, -180, 640, 360, tocolor(75, 75, 75, 255)}, -- Window {-320, -190, 426, 20, tocolor(23, 209, 248, 255)}, -- Tittle Line {-300, -160, 600, 60, tocolor(20, 20, 20, 255), "Arsenal", tocolor(255, 255, 255, 255), 3, "bankgothic", "center", "center"}, -- Tittle {-300, -80, 186, 100, tocolor(43, 43, 43, 255), "M4", tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center"}, -- Button 1 {-300, 40, 186, 100, tocolor(43, 43, 43, 255), "AK", tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center"}, -- Button 2 {-93, -80, 186, 100, tocolor(43, 43, 43, 255), "GLOCK", tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center"}, -- Button 3 {-93, 40, 186, 100, tocolor(43, 43, 43, 255), "Skin 1", tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center"}, -- Button 4 {114, -80, 186, 100, tocolor(43, 43, 43, 255), "Skin 2", tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center"}, -- Button 5 {114, 40, 186, 100, tocolor(43, 43, 43, 255), "VEICULO", tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center"}, -- Button 6 {-320, 140, 640, 40, false, "Para fechar aperte 'Backspace'", tocolor(255, 255, 255, 255), 2, "default", "center", "center"}, -- Close info } function paineldx () for i, infos in ipairs (layout) do -- Para cada item da tabela layout, faça: local posX, posY, sizeX, sizeY, colorRGBA, text, textColorRGBA, fontSize, fontFamily, alignX, alignY = unpack (infos) -- Separa as infos em variáveis. -- Layout Fixo: posX = (screenW / 2) + posX -- Faz com que o centro da tela seja a posição 0, 0. Centralizando as posições. posY = (screenH / 2) + posY -- Converte as posições centralizadas da tabela para posições absolutas. if colorRGBA then -- Só faz dxDrawRectangle se tiver o parâmetro colorRGBA. Se não tiver, é só um texto isolado. if i >= 4 and i <= 9 then -- Se for um botão, então: (se for do item 4 até o 9) if isMouseInPosition (posX, posY, sizeX, sizeY) then -- Se o mouse está em cima do botão, então: colorRGBA = tocolor(0, 0, 0, 255) -- Torna a cor do botão preto. end end dxDrawRectangle(posX, posY, sizeX, sizeY, colorRGBA, false) end if text then -- Só faz dxDrawText se tiver o parâmetro texto. sizeX = posX + sizeX sizeY = posY + sizeY dxDrawText(text, posX, posY, sizeX, sizeY, textColorRGBA, fontSize, fontFamily, alignX, alignY) end end end addEvent("HitM", true) addEventHandler("HitM", root, function() -- Função chamada pelo servidor quando este jogador colide no marker do server. if not painel then addEventHandler("onClientRender", root, paineldx) painel = true showCursor(true) end end) bindKey("backSpace", "down", function() -- Tecla que fecha o painel. if painel then removeEventHandler("onClientRender", root, paineldx) painel = false showCursor(false) end end) addEventHandler("onClientClick", root, function(button, state) if button == "left" and state == "down" then if painel then for i, infos in pairs (layout) do -- Neste caso uso pairs pois a ordem dos itens não importa. local posX, posY, sizeX, sizeY = unpack (infos) -- Separa as infos em variáveis. -- Layout Fixo: posX = (screenW / 2) + posX -- Converte a posição centralizada da tabela para posição absoluta. posY = (screenH / 2) + posY if isMouseInPosition(posX, posY, sizeX, sizeY) then if i == 4 then -- Se for o botão de M4, então: triggerServerEvent("setarAlgo", localPlayer, "weapon", 31, 9999) -- giveWeapon (source, 31, 9999) -- Não funciona client-side. elseif i == 5 then -- Se for o botão de AK, então: triggerServerEvent("setarAlgo", localPlayer, "weapon", 30, 9999) elseif i == 6 then -- Se for o botão de Glock, então: triggerServerEvent("setarAlgo", localPlayer, "weapon", 24, 9999) elseif i == 7 then -- Se for o botão de Skin 1, então: triggerServerEvent("setarAlgo", localPlayer, "skin", 28) elseif i == 8 then -- Se for o botão de Skin 2, então: triggerServerEvent("setarAlgo", localPlayer, "skin", 29) elseif i == 9 then -- Se for o botão de Vehicle, então: triggerServerEvent("setarAlgo", localPlayer, "vehicle", 560) end end end end end end) function isMouseInPosition (x, y, width, height) -- Função útil. 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 Server-side: local m1 = createMarker(2027.903, 1545.603, 10.819 -1, "cylinder", 1.5, 0,195,255, 100) local vehicles = {} addEventHandler("onMarkerHit", m1, function(hit) if getElementType(hit) == "player" then -- Se quem colidiu no marker for um jogador, então: if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (hit)), aclGetGroup ("Admin")) then -- Se o jogador está na ACL Admin, então: setTimer(triggerClientEvent, 250, 1, hit, "HitM", hit) else outputChatBox("Acesso negado.", hit, 255, 0, 0) end end end) addEvent("setarAlgo", true) addEventHandler("setarAlgo", root, function (tipo, id, ammo) -- Função chamada pelo client. Seta algo no jogador. if tipo == "weapon" then giveWeapon(client, id, ammo, true) elseif tipo == "skin" then setElementModel (client, id) elseif tipo == "vehicle" then local x, y, z = getElementPosition(client) if isElement (vehicles[client]) then -- Se já existe um veículo criado por este jogador, então: destroyElement(vehicles[client]) -- Destrói esse veículo antes de criar outro. end vehicles[client] = createVehicle(id, x, y, z + 1) -- Cria o veículo em cima do jogador. end end) function limpaVehicle() -- Destrói o veículo criado pelo jogador quando ele sair do servidor. if isElement (vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end addEventHandler("onPlayerQuit", root, limpaVehicle) addEventHandler("onPlayerDisconnect", root, limpaVehicle)
    1 point
  3. Thank you for answer, i have 24gb memory ram and have this problem, What do you think we should do to solve this problem? Because it is really annoying
    1 point
  4. This crash is caused by running out of video memory. https://wiki.multitheftauto.com/wiki/Famous_crash_offsets_and_their_meaning, Ctrl+F and search for 0x003C91CC. Most likely some script creates textures (fonts, etc), but does not remove them when they are not needed. Or it does not check that some element already exists. How can this be monitored: There is a showmemstat command that displays the free video memory for MTA and how much is used by fonts, textures, RTs (+ Screen Sources); There is a function dxGetStatus, which allows you to monitor this with a script. How to know which resource is using a texture/font/etc: 2 options: the performancebrowser resource that allows you to monitor the performance in the browser and the ipb resource that allows you to do it directly in the game. Then you need to select the Lua memory category and specify Client as the target*. By columns DxFonts (= dxCreateFont), GuiFonts (= guiCreateFont), Textures (= dxCreateTexture), RenderTargets (= dxCreateRenderTarget) and ScreenSources (= dxCreateScreenSource) you can understand whether there is a memory leak or not. *You can select any client only in the browser.
    1 point
  5. I think crash has disappear i was playing through 2hours and no crash Thank you so much for your help.I thnik it is end, unless you want something else :v . @Dutchman101
    1 point
  6. It's a system issue, (if you're interested, take a look at https://pastebin.com/wk5D5rBT -D3D9.dll @ 0x0010EA8F, as you can see no MTA calls are involved in the crash) what I advise is to update your GPU driver, and repair a potentially corrupt D3D9.dll: - Open commandprompt (cmd) as Administrator and type: dism /online /cleanup-image /restorehealth After it finishes, reboot your PC and open commandprompt once again. This type, type: sfc /scannow and wait for it to complete. When that is done, proceed to updating your drivers. To assist you with that, do the following: Please download and run MTADiag (rightclick > Run as Administrator) and follow the instructions. Press 'y' when asked to allow making changes, and 'n' when otherwise asked to. Post any Pastebin URL MTADiag gives you in this topic. Also when you look at this, https://www.google.com/search?q=0x0010EA8F even while it's a rare problem, you can see the underlying system issue is also capable of crashing other games. Edit - Btw, alternative for the Pastebin link at the beginning, about the specifics of this crash issue so others on the web that are affected can find it in the future.. in below spoiler. .. As per the last post in this topic, it turned out to be Windows OS / system file / d3d9.dll (either in system32 or the affected software's installation folder) corruption or non-original file problem
    1 point
×
×
  • Create New...