Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by vicisdev

  1. Think this is going to be really helpful in an inventory framework I'm planning to develop. Inventories have a strong customizability factor. Each use case is a unique use case. People would want to add their own stuff, etc. I'm pretty sure this module will allow me to do things much more automagically. One down side is that people would need to manually include the module binary. Not that this is of a great effort, but it's not very common.
  2. Yes! One particular useful case is to let people add as much assets (images, col, txd, etc) as they want and automatically add them into the meta.xml using the scanDir API
  3. Olá, Markin. Você pode usar a função dxDrawMaterialLine3D. Se você quer uma implementação como exemplo, existe essa aqui dxDrawImageOnElement.
  4. I hate asking for help because of that. It was obvious. Thank you
  5. I was expecting this to work, but custom events seem not cancellable. Is this how custom events should work? local number = 0 addEvent("customEvent") addEventHandler("onPlayerJoin", root, function() local player = source bindKey(player, "e", "down", function() number = number + 1 triggerEvent("customEvent", player) end) end) addEventHandler("customEvent", root, function() outputDebugString(number) if number % 2 == 0 then cancelEvent() end end) addEventHandler("customEvent", root, function() if wasEventCancelled() then outputDebugString("Cancelled") else outputDebugString("Called") end end, true, "low") To provide a little bit of context I was trying to implement a way for developers to cancel my custom events default behaviors using cancelEvent.
  6. If you are sure players will exit the car before it being drowned there could be a chance to do this.
  7. Olá. Você sabe programar Lua? Foi você quem escreveu o código desse painel?
  8. Eu tentei de várias formas, mas não consegui chegar à um resultado. O que eu percebi é que o Rhino já precisa de mais de duas bazucadas para finalmente explodir. Não era exatamente esse comportamento que você estava querendo?
  9. É parece que não é possível fazer isso não. O evento OnClientVehicleDamage não é acionado para explosões.
  10. I can't fix typos from last post anymore, my bad
  11. I still advise you to cautiously read through your code to understand if it's working properly. I think you were expecting to have a meat element inside the caixa table indexed by the source (a player), but that is not happening. Probably the line that was warning before isn't needed actually because since you are destroying the meat element later on the code all event handlers attached to it will also be deleted anyway.
  12. Para ser sincero isso deveria estar funcionando. Como não está funcionando da forma que a gente espera, a gente vai precisar debuggar o código para entender melhor quais valores estamos recebendo e se está sendo executado a funcionalidade esperada. Primeiro de tudo você precisa ter certeza do valor que você está recebendo em weapon na função warMachineDamage. Para isso comente o código completo e execute: function warMachineDamage(attacker, weapon, loss, x, y, z, tire) outputDebugString(weapon) end Com base no resultado que aparecerá no console do cliente, você conseguirá entender melhor o que está acontecendo assim que alguém causar algum dano num veículo. Agora me permita esclarecer uma coisa mais genérica em relação à programaçao. Você não precisa especificar todos os parâmetros de uma função caso não estiver usando-os. Por exemplo na função warMachineDamage o parâmetro que você está usando é apenas o weapon portanto os outros não precisam ser declarados com exceção do attacker. A mesma coisa acontece com o evento damageWarMachine não tem necessidade de enviar os parâmetros source, attacker, weapon e bodypart porque não estão realmente sendo usados na função de callback do evento.
  13. removeEventHandler("onElementClicked", caixa[source], onClick) The error is potentially at this line. I guess you probably meant: removeEventHandler("onElementClicked", source, onClick) But you have to make sure that's exactly what you expect your code to do. Tell me what does the table caixa do in your code?
  14. The event onMarkerHit is triggered anytime an element hits the marker, not only when a player hits a marker. Turns out the vehicle is also an element and usually when a player runs over a marker driving a vehicle the vehicle element hits the marker before the player element. You have two options: 1. Use onPlayerMarketHit instead. Note it's not a drop in replacement, you'll have to change your code to work with onPlayerMarkerHit 2. At the very top of the Cavar function, check for the element type before executing any action local function Cavar(hitElement) if getElementType(hitElement) ~= "player" then return end -- Here you place your current code end Excuse me to give you a general tip around programming. Avoid nesting to much if statements, always check by the failure condition and return your function. Dont: -- Evite muitos IFs encadeados! local function Cavar(hitElement) if getElementType(hitElement) == "player" then if not isPedInVehicle(hitElement) then --- code ... end end end Do: -- Muito mais elegante local function Cavar(hitElement) if getElementType(hitElement) ~= "player" or isPedInVehicle(hitElement) then return end -- code ... end You can find reference for onMarkerHit, onPlayerMarkerHit and getElementType on the official wiki.
  15. Best advice a server admin can get is: learn Docker. Looks like you have package libssl1.1 installed but the library file is named something else or located something else. You can try this hipotesis by executing: ls -l /usr/local/lib | grep libssl Paste the output here. Looking at the Debian package description we see the file you need is located under /usr/lib/x86_64-linux-gnu/libssl.so.1.1. Probably, all you have to do is create a symbolic link at the location where MTA Server is expecting to find libssl.so.1.1. sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/local/lib/libssl.so.1.1
  16. You can: 1. Comment that line to see if it stops erroing 2. Break down that line into multiple lines so you get a better visualization on what's happening 3. Avoid concatenating a SQL query string. The question marks can be used anywhere not only inside "VALUES (?,?,?)"
  17. I don't know how practical it is, but *maybe* you could follow a whitelist strategy as you block the jump control and then manually triggers the jumping animation programatically based on the players facing obstacles. To be honest I think it doesn't even worth bothering unless you've already seen something like this in another server.
  18. You want to display a list of created accounts ordered by account id?
  19. Yeee I see pool sessions finally available in MTA SA: be the most wanted pool player in San Andreas. Excellent work, I'm impressed.
  20. Guys go to any GitHub repository and press the period (.) key in your keyboard. Watch the magic happens... https://github.com/multitheftauto/mtasa-resources
  21. vicisdev

    CEF Issues

    Could you send me your files so I can inspect it better?
  22. vicisdev

    CEF Issues

    You should always check logs to see what is happening. Run your script in debug mode 3 and check the console output. You can: 1. OutputDebugString(inspect(theBrowser)) to see if it's being created properly 2. Try to load an external source (https://mtasa.com)
  23. vicisdev

    CEF Issues

    Excuse me. In fact, /local/ is supposed to be the resource name. So you would do http://mta/<resource_name>/<path_to_html> if your .html is located in another resource otherwise you can still use /local/ for files located in the same resource. You should add your index.html file using the <file /> tag in your meta.xml. https://wiki.multitheftauto.com/wiki/Local_Scheme_Handler
  24. vicisdev

    CEF Issues

    If you've written your meta.xml properly the URL should be http://mta/local/<path_to_.html>. You've missed the /local/.
  • Create New...