Jump to content

vicisdev

Members
  • Posts

    65
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

vicisdev's Achievements

Transformer

Transformer (11/54)

26

Reputation

  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
×
×
  • Create New...