Leaderboard
Popular Content
Showing content with the highest reputation on 16/09/21 in all areas
-
Hey everyone, As Lua decompiling is not really a topic we want to discuss or promote in these forums, the thread has been closed. We cannot interfere with anyone hosting these services outside of our platforms, but we ask that no hints or advertisements are made towards them.2 points
-
Oh, so that's what you've gone through. Workaround after workaround. Never tried custom weapons myself, but that's not the standard way to make peds shoot, so it's not really peds that you had a problem with, but rather a separate MTA feature that I've never seen being used anywhere else in GTA. But I guess you did it that way because you had issues getting them to shoot the standard way? I used to call setPedAimTarget and set the fire control state, and the peds would appear to shoot, the weapons would appear to fire, but the bullets sometimes wouldn't fly out. Turns out a NaN would appear somewhere in calculations in the game itself. But the problem would not occur at longer distances, so the workaround was simple: put the target thousands of units further in the same direction. Drive-by was even more problematic, I called setPedDoingGangDriveby along with setPedAimTarget, and while peds did appear to shoot, I never managed to get their bullets to fly out reliably, plus they were visually aiming in the wrong direction. And regarding info not being preserved between stream out and stream in: I create a ped. I give that ped a weapon using giveWeapon. Seems okay. Then I go further away and return back. The ped only has one bullet. If I try to make it shoot, it shoots one bullet and then continues the shooting animation but the weapon doesn't fire and no bullets appear. With no client-side giveWeapon, my workaround was to call it on the server side every couple seconds or so. Many other properties were not preserved either. Health being one of them, but this didn't get in the way when I had my own server because I had a custom health system anyway. I don't know how much the situation changed since then, I have been assuming things have improved, considering peds can enter/exit vehicles now. It's surely interesting to know how it all works. I agree, the game world just doesn't feel that empty with peds around. And you did what I didn't find time to do. You made peds more interactive, which is why yours feel more alive. But I couldn't limit myself to client-side peds. I understand your reasons, but when I make peds for players to interact with, I want them to be synced, because that's one of the things I love about MTA: synced peds. And if actual server-side peds were still too heavy for my purposes, I would try implementing my own using client-side peds and triggerServerEvent/triggerClientEvent. But to each their own, sometimes I get a bit perfectionistic with things like these ? I'm also happy to have someone to talk to about peds. When I was scripting mine, I felt alone. All I could see was people occasionally posting things like "is there a resource to have peds walking and driving everywhere?" People only wanting a traffic resource but not trying to make one themselves. It's not even that hard to make something basic that works. I currently can't run MTA because of some hardware issues (should be simple to resolve, just haven't gotten myself to do it for a while), but that isn't my focus. I've become better at programming in the recent years and I've learned to make my code much more reusable. What I've been thinking is that I could try making something that runs on anything running Lua, with minimal additional code needed to bind it specifically to MTA API.2 points
-
Hi there! This is a brief showcase of an advanced medical system I created as a part of my personal project roleplay gamemode; after completing this resource I took a short break and wanted to work on a small video project, I took that opportunity to create a showcase of the system and its functionalities. Feedback or any questions are always appreciated, thanks for checking it out!1 point
-
I don't know if having a decompiler is a good idea. Most of the time, scripts are compiled to prevent people from stealing them. Sometimes, some people will hide backdoors & malicious stuff in their scripts but that's why we have community.multitheftauto.com. Scripts uploaded to our community are always monitored. so if possible, please don't advertise any decompilers since it might be used to take credit for other people's work.1 point
-
Funcionou androski, muito obrigado, e outra... SOU TEU FÃ !!1 point
-
Olá! Por mais que eu não saiba a fonte desse script, irei te ajudar. Espero que não seja nada vazado. Além disso, uma observação sobre o conteúdo do seu tópico. Quando se trata de um código com muitas linhas, prefira usar a ferramenta de Spoiler. Dessa forma, não fica algo muito gigantesco na tela dos usuários. Você pode encontrar essa ferramenta aqui: https://i.imgur.com/DrdiJgj.png Agora, dada as devidas informações, aqui está o código que deve funcionar (não testei!): function getChatMessage(message, page) if message then if page == "anonymous" then triggerClientEvent(root, "setChatMessage", resourceRoot, "Anonimo: " .. message, page) elseif page == "local" then -- Adiciona uma nova verificação para a página local local x, y, z = getElementPosition(client) -- Obtém a posição do jogador que enviou a mensagem local playersInRange = getElementsWithinRange(x, y, z, 10, "player") -- Obtém apenas os jogadores que estão numa distância de 10 metros triggerClientEvent(playersInRange, "setChatMessage", resourceRoot, getPlayerName(client) .. ": " .. message, page) -- Envia a mensagem apenas para os jogadores que estão próximos else triggerClientEvent(root, "setChatMessage", resourceRoot, getPlayerName(client) .. ": " .. message, page) end end end addEvent("getChatMessage", true) addEventHandler("getChatMessage", resourceRoot, getChatMessage)1 point
-
Olá! Você pode limitar de duas formas, mas eu teria que saber qual é o propósito. De qualquer forma, vou escrever um exemplo de como seria. local playersInArena = {} -- Tabela onde os jogadores serão armazenados local maxPlayersInArena = 1 -- Máximo de jogadores na arena function joinArena(player) if #playersInArena >= maxPlayersInArena then -- Se o total de entradas na tabela for maior ou igual ao máximo, então iremos parar o código return false end playersInArena[#playersInArena + 1] = player -- Armazena o jogador na tabela setElementPosition(player, 0, 0, 3) -- Apenas como teste, isso irá mover o jogador para o centro do mapa end addCommandHandler("entrar", joinArena) function freeMemory() for index, player in ipairs(playersInArena) do if player == source then playersInArena[index] = nil end end end addEventHandler("onPlayerWasted", root, freeMemory) -- Anexa um evento na função » freeMemory «, caso o jogador morra addEventHandler("onPlayerQuit", root, freeMemory) -- Anexa um evento na função » freeMemory «, caso o jogador saia do servidor Faça as adaptações da maneira que desejar.1 point
-
For that reason Sphene will also feature a compiler/decompiler directly build-in and in time a way to create SCM scripts using a in-game editor (like DYOM) that can be both run in Sphene and singleplayer. But with Sphene you could have the added benefit of being able to add a Co-Op experience on top of your missions. Naturally this is just something I'd love to see but that's not going to be finished for quite a while. NOTE: We are looking for a community manager to help us with building out our community and help us figure out said strategies.1 point
-
To me CO-OP was the first idea I had when searching for GTA SA multiplayer back in 2008. But I think that we will have to advertise this feature to people that use DYOM or CLEO as content creators. Just imagine if Megadreams does all this work for nothing. If we get the passion of these people then it is more likely that their followers will reach us too. Like with any strong addition to our multiplayer engine we also need a good release strategy. This could be the thing that attracts people!1 point
-
Wow, I've had an idea like this myself a long time ago - didn't think that someday someone would make this. Where does the SCM execution take place? Server or client? When I had the idea, I was thinking it should be on client because some parts of SCM scripts are supposed to work without delay for the player. For example, if we have an operation "wait 0", execution will wait for the next frame before proceeding. But what I considered the problem was that if the script creates elements (like vehicles) and they're supposed to be synced, the client has to tell the server to create the element, and since there will be a delay before the client becomes aware of that element, execution will have to pause as SCM script won't be able to use the element which doesn't exist on the client yet. But now it doesn't look like a big problem, just making some wrapper that will take care of sync stuff, and operating on that wrapper. On the other hand, relying on client to tell the server what to do may cause problems like hackers creating lots of cars in one place, or creating an army of peds and sending them after some player But making all SCM scripts of GTA work with this is much more than just making an interpreter, right? SCM relies on lots of other functionality that has to be reimplemented in Lua. Ped AI, zones, gang wars, wanted levels. I mean some of those things are big enough to be made into separate projects, with SCM interpreter using them as dependencies. Anyway, looks great, and I hope you guys will be able to do even better.1 point
-
Isso não seria um sistema de médico? Tente isto: addCommandHandler ("s", function (thePlayer, command, Jogador) local accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("SAMU")) then if Jogador then local targetPlayer = getPlayerFromName ( Jogador:gsub("#%x%x%x%x%x%x", "") ) else return outputChatBox ( "Sintaxe incorreta! /"..command.." <nome_do_jogador>", thePlayer ) end if targetPlayer then setElementHealth ( targetPlayer, getPedMaxHealth(targetPlayer) ) triggerClientEvent(thePlayer, "SAMU", thePlayer) setPedAnimation(thePlayer, "medic", "CPR") outputChatBox ( "Você foi curado por "..getPlayerName(thePlayer).." !", targetPlayer ) outputChatBox ( "Você curou o jogador "..getPlayerName(targetPlayer).." !", thePlayer ) else outputChatBox ( "Não há nenhum jogador chamado " .. Jogador .. "!", thePlayer ) end else outputChatBox ( "Você não pode usar este comando", thePlayer ) end end) function getPedMaxHealth(ped) -- Output an error and stop executing the function if the argument is not valid assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") -- Grab his player health stat. local stat = getPedStat(ped, 24) -- Do a linear interpolation to get how many health a ped can have. -- Assumes: 100 health = 569 stat, 200 health = 1000 stat. local maxhealth = 100 + (stat - 569) / 4.31 -- Return the max health. Make sure it can't be below 1 return math.max(1, maxhealth) end1 point
-
Hello, good afternoon, I wanted to talk about my server called MTA ARG In Fierrados, we are currently on the internet list, the server does not contain any resource / script from another server, nor do we have cars from another server, all the real car skins that we have do not have brand are totally clean I speak because previously I had a problem with a victim that the MTA staff was supporting I don't want to have any more problems, the whole new server is complete with nothing copied, no mapping / auto / script etc .. regards atte gimbo (I leave this post so that if someone accuses me of something I already said in advance that I had nothing) (you can enter to check it too) 16 September 16:14 pm0 points