Jump to content

Rougue90

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Rougue90

  1. Você pode usar o SetWeaponProperty e modificar a propriedade maximum_clip_ammo pra colocar a quantidade que quiser na arma que desejar.
  2. Olá Doongogar, infelizmente acredito que não terá a solução pra isso aqui no fórum. Essa batalha contra cheater / spoofers acontece sim e há uma ideia rolando contra Spoofers. Hoje há poucos servidores com o projeto rodando. Caso encontre sua solução para criar um anti-spoofer, peço que por gentileza não à exponha aqui no fórum. Por motivos meio óbvios nenhum criador de Cheater expõe a vulnerabilidade do MTA para continuar abusando e a vulnerabilidade nunca é arrumada, logo nós desenvolvedores não devemos expor nossos métodos para contra-atacar. Evite o máximo expor suas ideias, teste-as e ofereça a solução para os servers em você ver que há mais problemas em relação a cheaters. Os donos de tais servidores podem fazer o trabalho de expor suas ideias para quem estiver desenvolvendo o anti-spoofer. Enfim, apresente sua ideia e sua solução, caso a encontre, para as pessoas certas.
  3. É impossível descompilar arquivos em .luac. Você precisa entrar em contato com o criador do script e solicitar o código descompilado caso queira.
  4. Da uma olhada no programa do seu mouse, alguns vem com configuração de perfil, você consegue configurar DPIs diferentes em jogos diferentes. Todas vez que vc estiver na tela do jogo ele entra a DPI do jogo, e quando você sai pra area de trabalho entra outra DPI. Pode ser o seu caso.
  5. -- client side bindKey("f", "down", function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then triggerServerEvent("onPlayerToggledInvisibility", localPlayer, vehicle) end end) -- server side function onPlayerToggledInvisibility(vehicle) if vehicle then local list = getElementsByType('player') -- we need to get every player so when can give a different message for i, player in pairs(list) do if player ~= client then -- if player we get is different from the one that trigger the server event outputChatBox(getPlayerName(client) .. "pressed the f button", player) --to other player will show in chat that someplayer press F button else outputChatBox("you pressed the f button", client) -- to the player who pressed will show you pressed end end end end its not good send localPlayer as argument to triggerServerEvent. If you want to use who trigger's it, on server side you can use client variable.
  6. I believe that is because you have been destroying variable marker, and not the source of onMarketrHit. So every time you hit any cylinder, the code will destroy the last cylinder in variable marker Try this one to destroy do source of hit garbages = { {-1881.14380, -1707.47888, 21.75000}, {-1885.83081, -1723.84656, 21.75641}, {-1896.03723, -1731.46301, 21.75000}, {-1908.80933, -1733.61536, 21.75000} } function pickup(player) for i,garbage in pairs(garbages) do marker = createMarker(garbage[1], garbage[2], garbage[3], "cylinder", 3.0) function picked(player) destroyElement(source) -- here the modification end addEventHandler("onMarkerHit", marker, picked) end end If it helped, pls give rep+.
  7. Tem sim, você consegue ativar ou desativar via script usando setTransferBoxVisible(). essa é uma função Shared, então você pode fazer uma verificação server-side se o jogador estiver logado e fazer uma trigger para desativar se ele estiver. Esse script deve esconder a barra de download sempre que o player estiver online e para qualquer resource iniciada. Server-side: addEventHandler('onResourceStart', root, function(resource) local players = getElementsByType('player') for i, j in pairs(players) do if not isGuestAccount(getPlayerAccount(j)) then triggerClientEvent(j, 'esconde', resourceRoot()) end end end) Client-Side: addEvent('esconde', true) addEventHandler('esconde', root, function() setTransferBoxVisible(false) end)
  8. Olá, você pode fazer desse jeito local function burn(commandName, theSize) if tonumber(theSize) then fogo = setTimer(function(theSize) --criamos o timer local x, y, z = getElementPosition(getLocalPlayer()) createFire(x, y+5, z, tonumber(theSize)) --Recomendo fazer x+5 ou y+5 pra quando criar a fogueira, não incendiar o jogador end, 10000, 0) -- o valor 10000 é o fogo sendo criado a cada 10 segundos, você pode diminuir se julgar necessário. O 0 é para que ele nunca pare de ser criado. outputChatBox("É SÃO JOÃO UHUU :)") else outputChatBox("Syntax: /fire <size>") killTimer(fogo) -- esse aqui é pra quando você quiser que o fogo se apague, digitando a syntax errada 'mata' o timer e para o loop. end end addCommandHandler("fire", burn) Lembrando que o CreateFire() é um código client-side, ou seja, só quem digitou /fire irá ver a fogueira. Caso queira que seja visivel para todas, deve fazer a função no client-side, e fazer uma triggerClientEvent() no server-side.
  9. Acredito que não faça diferença nenhuma, mas sim quando for quando for usar os operadores OR e AND, acredito que fica mais facil de visualizar as comparações separadamente. Mas em si, a utulização de com ou sem os parenteses, não tenha nenhum efeito prático na leitura do script. Novamente, não tenho certeza, mas o que eu acredito que seja.
  10. Se os seus paineis são abertos por binds, você pode criar uma trigger server side pra quando o cliente logar, bindar os paineis.
  11. Wow, indeed. I don't know why i did that way, Thank you So the verification must compared to an int value local id = getElementModel(getPedOccupiedVehicle(LocalPlayer)) if id == 407 then --YOUR CODE
  12. getPedOccupiedVehicle() should be receiving LocalPlayer, and i will return the Element Vehicle. Then you can use GetElementID() to compare here. Something like this i believe: local id = getElementID(getPedOccupiedVehicle(LocalPlayer)) if id == '407' then --YOUR CODE If you have a doubt, just ask or if it helped, you can leave a thanks ?
  13. local proibido = { --Essa é a lista de id de veiculos que você quer bloquear, caso queira adicionar o Hydra, ou o Hustler 425, --É só adicionar o id de cada um na tabela 447 } local function enterHeli(heli) local entrou = getElementModel(heli) -- Ve qual o id do veiculo for i,j in pairs(proibido) do if entrou == j then -- compara se o id do veiculo é um dos que está bloqueados toggleControl('vehicle_fire', false) --desbinda um dos comandos toggleControl('vehicle_secondary_fire', false) --desbinda o outro return end end toggleControl('vehicle_fire', true) -- se não for nenhum dos carros proibidos então ele binda, nesse caso funciona atirar com o hydra e o rustler toggleControl('vehicle_secondary_fire', true) end addEventHandler('onClientPlayerVehicleEnter', root, enterHeli) -- evento que vai iniciar a verificação quando o jogador entrar em qualquer veiculo Nota que esse script deve ser colocado em client-side, aproveite usar o script para estudo. Caso tenha alguma duvida pergunte, se não tiver deixe o Thanks.
  14. Olá, boa noite. O GiveWeapon também funciona se você passar uma string com o nome da arma, por isso seu código esta dando esse erro. o getWeaponIDFromName(weaponName) está atribuindo o id da minigun pra variavel id. Para fazer seu código funcionar da maneira que eu imagino que queria, o player digitando o nome da arma, e ja recebendo. Isso não seria possivel pois à armas que tem o nome composto, por tanto não seria tão simples usando o eventHandler onPlayerCommand, pos esse evento só recebe o cmd e nenhum argumento a mais. Essa versão seria mais tranquila de manipular: local ilegal = { 'minigun', 'rocket' } local armas = { [22] = 'pistol', --Entre o colchete entra o id da arma, recebe o valor 'comando' que o player digita pra receber a arma | caso queira adicionar mais [23] = 'silenced', [24] = 'deagle', [25] = 'shotgun', [26] = 'saw', [27] = 'combat', [28] = 'uzi', [29] = 'mp5', [32] = 'tec', [30] = 'ak', [31] = 'm4', [33] = 'rifle', [34] = 'sniper' } addEventHandler("onPlayerCommand", root, function(cmd) weaponName = string.lower(cmd) iprint(weaponName) for i, j in pairs(ilegal) do if weaponName == j then -- verifica se o jogador digitou o nome de uma das armas que estão proibidas e exibe mensagem outputChatBox(' you cannot have this gun', source, 255, 0, 0) return end end for i, j in pairs(armas) do if weaponName == j then -- verific se o nome digitado está na tabela de armas giveWeapon(source, i, 1000, true) -- aqui entregamos o valor do i, pois dizemos que essa é a key da tabela que esta OK outputChatBox("[ CDC-Info ]: Você recebeu 1000 unidades de munição para a arma: " .. weaponName, source, 255, 60, 0, true) return end end end) Caso tenha alguma duvida, pergunte. Se não tiver deixe o Thanks
  15. Boa tarde, esse código só ira funcionar quando estiver dentro de um veiculo, e quando você reiniciar qualquer outra resource. Essa linha, você esta chamando a função quando reinicia qualquer resource. Pra chamar essa função pra quando reiniciar, ou iniciar apenas a resource do codigo, substitua o ROOT por getResourceRootElement(getThisResource()). Acredito que seja por isso que esteja dando esses erros. Talvez queira colocar para retirar a colisão quando usar um comando, usando addCommandHandler(). Qualquer dúvida, só perguntar.
  16. Hi, you can still be using setPedAnimation() but you must give the right parameters. If you want that the animation play whenever the player is falling just set parameter 7, to false. Something like this: function animacao(player) setPedAnimation(player,'kart', 'kart_getin_lhs', 5000, true, true, false, false) --the first false in this parameter, enable the animation to play while the player is falling, if it's true, than it wait the falling animation to end, so it can be started end addCommandHandler('anim', animacao,false, false)
  17. Olá, você poderia começar olhando a função setElementFrozen para resolver o problema do player empurrar o veiculo. Em relação a porta não vi nenhuma função ou algo que possa te ajuda com relação as portas. Mas com certeza se fizer a famosa gambiarra usando CreateObject e attachElements, você consiguirá resolver seu problema. Mas terá que fazer um código para cada carro pois as posições de cada porta mudam. E não sei ao certo se o objeto seguiria a porta do carro ou o carro em si, mas é mais provavel que o objeto siga o veiculo como um todo.
  18. function getpos (source) x,y,z = getElementPosition(source) interior = getElementInterior(source) Dim = getElementDimension(source) zone = getZoneName(x, y, z, false) city = getZoneName(x, y, z, true) r1,r2,r3 = getElementRotation(source) outputChatBox("Your Rotation is: "..tostring(r1)..", "..tostring(r2)..", "..tostring(r3)..".", source, 0, 255, 0) outputChatBox("You are at: "..tostring(x)..", "..tostring(y)..", "..tostring(z)..".", source, 0, 255, 0) if not fileExists('arquivo.txt') then -- Aqui verificaremos se o arquivo existe archive = fileCreate('arquivo.txt') -- Aqui criamos e atribuimo archive como variavel para indicar o arquivo no primeiro momento else archive = fileOpen('arquivo.txt') -- se o arquivo ja existir, ou seja, se você ja tiver digitado o /getpos 1 vez, iremos ler o arquivo e atribuir o arquivo para a variavel 'archive' fileRead(archive, fileGetSize(archive)) -- quando usamos o fileRead() automaticamente levamos o 'cursor' de digitação pra onde queremos, no caso o segundo parametrô recebe fileGetSize() que vai retornar a quantidade de byte do arquivo, e indicar o 'cursor' pra la end fileWrite(archive, ""..tostring(x)..", "..tostring(y)..", "..tostring(z)..". rotation: "..tostring(r1)..", "..tostring(r2)..", "..tostring(r3).."\n") -- o /n é para dar 'enter' dentro do arquivo, se não tiver ele vai escrevendo pra frente infinito. Aqui ele escreve as coordenadas e da um enter no arquivo, se preparando para o prox /getpos fileClose(archive) -- Aqui o arquivo é salvo e atualizado end Segue o codigo comentado para estudo e funcionando. Se houver alguma dúvida, não deixe de perguntar. Caso queira que as linhas virem tabela tbm, para facilitar encontrar os dados faça essa modificação no fileWrite do seu arquivo fileWrite(archive, "{"..tostring(x)..", "..tostring(y)..", "..tostring(z)..". rotation: "..tostring(r1)..", "..tostring(r2)..", "..tostring(r3).."}\n") Garanto que no futuro quando for manipular, irá ser mais facil em grande quantidades.
  19. So even if i use OnPlayerQuit, you means that if i turned off the server with Player, the information of that players would get lost? Because if i close server's connection and is different from players leaving, right? Dont think it would be a problem, since the player can only play logged in. Well, kind it is what is going on now, a part that i'm using functions from MTA.
  20. I'm creating a gamemode (trying at least, learning), I'm in doubt about how to save information about points, cash, kills and deaths of players. Currently the scripts are working in this logic: User register account -> addAccountData() creating the respective information. Player make login -> GetAccountData() -> setElementData(). Player quit -> GetElementData() -> setAccountData() I understood that the information is saved in internals, but if I want to make a ranking panel, or optimize the flow of information and the server it self, which option is more suitable? Use sqlQexecuteQuery and start saving and manipulating information in the registry or continue with the method I'm using?
  21. Estou criando uma gamemode (tentando pelo menos, aprendendo), estou com dúvida sobre como salvar a informação de pontos, cash, kill e deaths dos jogadores. Atualmente os scripts estão funcionando nessa lógica: RegistraConta -> addAccountData() criando as informações respectivas. Login -> GetAccountData() -> setElementData() Entendi que a informação fica salva em internals, mas caso eu queira fazer um painel de rank, ou otimizar o fluxo de informação, qual opção é mais adequada? Usar o sqlQexecuteQuery e começar a salvar e manipular a informação no registry ou continuar com o método que estou usando?
  22. serial: C452203CED0ABF5F665EE8F55249A5B3
  23. hello, my idea is make a few teams, something around 10 teams. Soo, when i spawn the player in their base, i do something like addEventHandler('onPlayerSpawn', root, function() local team = getPlayerTeam(source) local players = getPlayersInTeam(team) for i,v in ipairs(players) do createBlipAttachedTo(v, 0, 2, 255, 100, 100, 255,0, 65535, players) end end) But i want it to each team, have it blip with it own color set. Need few idea to manage
  24. Hi, this is my first post in mta forum. Im triyng to make a script that kills everyone out of an area/col, how can i do it?
×
×
  • Create New...