Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/02/21 in all areas

  1. skin Andrzeja Dudy, dodatkowo obiekt długopisa na głowę (pod MTA, wystarczy attachElements) filmik prezentujący skin link do pobrania na desperadosa skin został wykonany przeze mnie, paczka jest na mega więc link na pewno nie wygaśnie, jak robicie reuploady to najlepiej podawajcie ten link
    1 point
  2. Few days ago i started discussion about javascript in mta, for more details checkout https://github.com/multitheftauto/mtasa-blue/discussions/2008 I'm waiting for opinions, suggestions, and everything what can help, here, on at github I already made working "hello world" example
    1 point
  3. Olá. Há toda uma polêmica sobre o uso dessas funções, por conta de desempenho dentro do servidor. Minha recomendação é que você dê uma estudada em tabelas, e também sobre como sincronizá-las. Mas vamos lá. A função setElementData possui um quarto parâmetro, sendo os valores aceitos true ou false. Caso você não for usar o dado no outro lado, opte por definir como false. Por padrão, você não precisa mexer nisso, a menos que seja necessário ter o dado em ambos lados, tanto client-side como também server-side. Aqui um exemplo: -- Server-side addCommandHandler("uuu", function(player) setElementData(player, "player.accountName", getAccountName(getPlayerAccount(player))) end) -- Client-side addCommandHandler("account", function() local cAccountName = getElementData(localPlayer, "player.accountName") or "?" outputChatBox("A sua conta é: " .. cAccountName) end) Pelo amor de Deus, nunca faça algo assim.
    1 point
  4. I have gone ahead and closed your thread. In the future, instead of mentioning others, please use the report feature. Click the 3 dots in the upper right of your post.
    1 point
  5. Oops... thanks! Now it's working like a charm!
    1 point
  6. You need to parse radians to it, like this isMouseInCircleSector(sx/2, sy/2, 330, math.rad(0), math.rad(90))
    1 point
  7. If you only want to see if the point is inside one of the circle's quadrants, it can be done really simple. If you want to check for any sector, I have made the following, where you define the sector from two angles. It would also be possible to define the sectors from vectors instead. local sx, sy = guiGetScreenSize( ) function isMouseInCircleSector(cx, cy, r, angleStart, angleEnd) local mx, my = getCursorPosition() if not mx then return end -- Relativise mouse position to circle center mx = mx * sx - cx my = my * sy - cy -- Convert angles to vectors local x1, y1 = r * math.cos(angleStart), r * math.sin(angleStart) local x2, y2 = r * math.cos(angleEnd), r * math.sin(angleEnd) return mx^2 + my^2 <= r^2 and -- Check if within radius -x1*my + y1*mx <= 0 and -- Check if counterclockwise to angleStart -x2*my + y2*mx > 0 -- Check if clockwise to angleEnd end Where: cx, cy = Circle center r = Circle radius angleStart = start of sector, in radians angleEnd = end of sector, in radians So as an example, here are the angleStart and angleEnd values for each quadrant 270, 0 - First quadrant 180, 270 - Second quadrant 90, 180 - Third quadrant 0, 90 - Fourth quadrant Hope it's useful
    1 point
  8. use a triple check, first whether the cursor is in a large circle, then whether the cursor is in a small circle, and whether the cursor is in a triangle x, y - cursor coordinates x1, y1, x2, y2, x3, y3 - coordinates of the angles of the triangle the function returns true if the point x, y belongs to a triangle function getPosition(x, y, x1, y1, x2, y2, x3, y3) local k = (x1 - x) * (y2 - y1) - (x2 - x1) * (y1 - y) local m = (x2 - x) * (y3 - y2) - (x3 - x2) * (y2 - y) local n = (x3 - x) * (y1 - y3) - (x1 - x3) * (y3 - y) return ((k >= 0 and m >= 0 and n >= 0) or (k <= 0 and m <= 0 and n <= 0)) end
    1 point
  9. This crash (offset 0x002FEC20) is caused by game mods as well, more specifically it most likely are roadsign texture/model mods. Like for example, a corrupted or missing "roadsignfont" texture in particle.txd (which is located in GTA San Andreas\models folder) can cause it. We aren't sure whether or not server mods like that (a server running bad roadsign textures) can also cause players to crash, if their GTA isn't modded. If yours is modded, it's just another example that game stability isn't guaranteed, unless you play with the original unmodded game. It is easier to once again re-install your GTA, instead of spending time to find the problem in ways i described (roadsign mods). if it's not modded, contact the server owner with this information
    1 point
  10. Você tem que colocar se o painel está true ou false exemplo: if painel == true then if isMouseInPosition(screenW * 0.3133, screenH * 0.4102, screenW * 0.3969, screenH * 0.4883) then com isso só vai poder clicar quando o painel estiver true. No caso quando estiver aberto.
    1 point
  11. Olá. Não, você não precisa de uma conta no GitHub. Basta acessar o repositório do dgs e seguir a imagem abaixo, após clicar no botão Code, que está na cor verde.
    1 point
×
×
  • Create New...