Jump to content

tasty

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by tasty

  1. A playSound funkció kliensoldali. Ezt kliensként kell használnia kiszolgáló helyett, ezért próbálja meg ezt: function Zene () local sound = playSound("zene.mp3") setSoundVolume(sound, 0.5) end addEventHandler("onClientPlayerJoin", localPlayer Zene)
  2. Função para detectar morte do jogador no server: onPlayerWasted - Multi Theft Auto: Wiki No client: onClientPlayerWasted - Multi Theft Auto: Wiki Utilizando o onClientPlayerWasted: messages = { "Better luck next time", "Don't think you're so cool now, do you?", "Nice one, pal", "Your opinion is void" } function wastedMessage ( killer, weapon, bodypart ) local randomID = math.random ( 1, #messages ) --get a random ID from the table local randomMessage = messages[randomID] --use that to retrieve a message outputChatBox ( randomMessage, 255, 0, 0 ) --output the message end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wastedMessage ) --add an event for the local player only Utilizando o onPlayerWasted: -- register player_Wasted as a handler for onPlayerWasted function player_Wasted ( ammo, attacker, weapon, bodypart ) -- if there was an attacker if ( attacker ) then -- we declare our variable outside the following checks local tempString -- if the element that killed him was a player, if ( getElementType ( attacker ) == "player" ) then -- put the attacker, victim and weapon info in the string tempString = getPlayerName ( attacker ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" -- else, if it was a vehicle, elseif ( getElementType ( attacker ) == "vehicle" ) then -- we'll get the name from the attacker vehicle's driver tempString = getPlayerName ( getVehicleController ( attacker ) ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")" end -- if the victim was shot in the head, append a special message if ( bodypart == 9 ) then tempString = tempString.." (HEADSHOT!)" -- else, just append the bodypart name else tempString = tempString.." ("..getBodyPartName ( bodypart )..")" end -- display the message outputChatBox ( tempString ) -- if there was no attacker, else -- output a death message without attacker info outputChatBox ( getPlayerName ( source ).." died. ("..getWeaponNameFromID ( weapon )..") ("..getBodyPartName ( bodypart )..")" ) end end addEventHandler ( "onPlayerWasted", root, player_Wasted )
  3. You need to start pAttach and then start your script. Always start he dependency before starting the scripts that depends on your dependency. start pAttach -> then start your script. do not start your script then start pAttach.
  4. You can set the element visible to in the marker: marker createMarker ( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, element visibleTo = getRootElement( ) ] )
  5. The error is clearly on your debugscript. Just start the rsource pAttach that your script is requesting.
  6. You can set data to the the item from the gridlist and get it later, Idk if it's what you want but it should work: DGS = exports.dgs function clientsideResourceStart () local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 ) if ( column ) then local row = DGS:dgsGridListAddRow ( numberList ) local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ^ 100 ) ) DGS:dgsGridListSetItemData ( numberList, row, column, "Test" ) local myItemData = DGS:dgsGridListGetItemData ( numberList, row, column ) outputChatBox ( "My gridlist item data: " .. myItemData ) end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart )
  7. If possible, share your fix, so if anyone else face this he can fix too
  8. Você precisa usar o evento: -- Client: addEventHandler("onClientPlayerQuit", root, function()) -- Server: addEventHandler("onPlayerQuit", root, function()) Ao triggar este evento, você irá utilizar o destroy element no carro: destroyElement(carro) Envie nos o código do painel para te ajudarmos melhor
  9. Algumas funções tem o lado client e o lado server, o MarkerHit é um exemplo. Para usar como client: addEventHandler("onClientMarkerHit", marker, função) No server-side: addEventHandler("onMarkerHit", marker, função) Arrumei seu código, você pode colar isso aqui em seu client script e deve funcionar: local visible = false local mrk = createMarker (2493.9443359375,-952.806640625,81.248107910156, "cylinder", 2, 211, 102 ,13) local screenW, screenH = guiGetScreenSize() function painel() dxDrawLine((screenW * 0.2632) - 1, (screenH * 0.3021) - 1, (screenW * 0.2632) - 1, screenH * 0.7526, tocolor(45, 191, 25, 254), 1, false) dxDrawLine(screenW * 0.7801, (screenH * 0.3021) - 1, (screenW * 0.2632) - 1, (screenH * 0.3021) - 1, tocolor(45, 191, 25, 254), 1, false) dxDrawLine((screenW * 0.2632) - 1, screenH * 0.7526, screenW * 0.7801, screenH * 0.7526, tocolor(45, 191, 25, 254), 1, false) dxDrawLine(screenW * 0.7801, screenH * 0.7526, screenW * 0.7801, (screenH * 0.3021) - 1, tocolor(45, 191, 25, 254), 1, false) dxDrawRectangle(screenW * 0.2632, screenH * 0.3021, screenW * 0.5169, screenH * 0.4505, tocolor(35, 75, 33, 244), false) dxDrawText("Trabalho Ilegal -BVC", screenW * 0.2559, screenH * 0.3021, screenW * 0.7750, screenH * 0.3607, tocolor(96, 248, 88, 254), 1.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Ganho: R$ 580", screenW * 0.4169, screenH * 0.4688, screenW * 0.6110, screenH * 0.5625, tocolor(16, 189, 7, 254), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawLine((screenW * 0.4176) - 1, (screenH * 0.5977) - 1, (screenW * 0.4176) - 1, screenH * 0.6641, tocolor(16, 189, 7, 254), 1, false) dxDrawLine(screenW * 0.6125, (screenH * 0.5977) - 1, (screenW * 0.4176) - 1, (screenH * 0.5977) - 1, tocolor(16, 189, 7, 254), 1, false) dxDrawLine((screenW * 0.4176) - 1, screenH * 0.6641, screenW * 0.6125, screenH * 0.6641, tocolor(16, 189, 7, 254), 1, false) dxDrawLine(screenW * 0.6125, screenH * 0.6641, screenW * 0.6125, (screenH * 0.5977) - 1, tocolor(16, 189, 7, 254), 1, false) dxDrawRectangle(screenW * 0.4176, screenH * 0.5977, screenW * 0.1949, screenH * 0.0664, tocolor(107, 0, 0, 254), false) dxDrawText("Pegar Trabalho ", screenW * 0.4169, screenH * 0.5951, screenW * 0.6125, screenH * 0.6641, tocolor(207, 141, 36, 199), 1.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Carga de Maconha", screenW * 0.4206, screenH * 0.3867, screenW * 0.6110, screenH * 0.4557, tocolor(107, 0, 0, 254), 2.00, "diploma", "center", "center", false, false, false, false, false) end function abrirPainel() if not visible then visible = true addEventHandler("onClientRender", getRootElement(), painel) else visible = false removeEventHandler("onClientRender", getRootElement(), painel) end end addEventHandler("onClientMarkerHit", mrk, abrirPainel) addEventHandler("onClientMarkerLeave", mrk, function () visible = false removeEventHandler("onClientRender", getRootElement(), painel) end)
  10. Sorry. I didn't understand your question. Do you want to have the count of users on your DISCORD server from your mta? Example, do you want to run /users on your MTA server and get the count of users from your DISCORD server?
  11. Há muito conteúdo disponível na internet. Você pode aprender até lendo scripts de outras pessoas, você pode encontrar vários no repositório de resources do próprio MTA: Há muitos videos tambem. Como Programar Em Lua - MTA #1: Até no próprio WIKI do mta tem uma introdução ao scripting: Espero ver você em breve
  12. Basta remover a condicional do inWater então. function setPlayerOnFire(cmd, playerName) local player = getPlayerFromName ( playerName ) if player then local notOnFire = not isPedOnFire(player) if notOnFire then setPedOnFire(player, true) end end end addCommandHandler("fogo", setPlayerOnFire) Espero que esse funcione
  13. Tente com isso: function setPlayerOnFire(cmd, playerName) local player = getPlayerFromName ( playerName ) if player then local inWater = isElementInWater(player) if inWater then local notOnFire = not isPedOnFire(player) if notOnFire then setPedOnFire(player, true) end end end end addCommandHandler("fogo", setPlayerOnFire) Não testei no jogo, mas creio que deva funcionar
  14. You need to provide us your OS, firewall used and so on.. so we can better help you.
  15. I think naturally Windows will use more resources than Linux machines. Try dockering all your servers.
  16. tasty

    HELP

    Have you opened all ports ? 22003 22005 2216?
  17. Esse painel P que está usando não aparenta ser o default do MTA. Verifique se ele está corretamente adicionado no ACL Admin, se não estiver, utilize o painel default para adicionar ou adicione no mods/deathmatch/acl.xml e digite "reloadacl" no servidor, para recarregar a ACL.
  18. Are you running the MTA server from your local machine? Some ISP doesn't allows port forwarding.
  19. Você pode deixar o DGS em qualquer pasta. Tenha certeza que iniciou ele antes de qualquer outro mod.
  20. Seu código está escrito fim? Se sim, altere para end. Consegue deixar um print de seu debugscript 3?
  21. Have you opened the 22126 port? It's a UDP port.
  22. To administrate my 3 MTA servers I use the discord. I can reboot the servers, send commands to it and things related. All my servers are under containers, so I can easily change the resource limits and so on. It's more "secure" then leaving it on the web, because you can set for your usage only, with your unique DISCORD ID.
  23. Hi, Have you unlocked them from iptables? iptables -I INPUT -p tcp --dport 22005 -j ACCEPT iptables -I INPUT -p udp -m multiport --dports 22126,22003 -j ACCEPT This should hit fine.. It's what I do on my end to fix.
  24. Hello all, I've customized a docker image to run more than one MTA server per VPS server. You can take a look on it here: -> https://github.com/silveiraV/mta-dockerized By using containers, you can easily set limits for each server, like CPU and RAM limits. I was using it only for personal purpose, and decied to share here. Hope you enjoy it.
  25. Hello all, I've customized a docker image to run more than one MTA server per VPS server. You can take a look on it here: -> https://github.com/silveiraV/mta-dockerized By using containers, you can easily set limits for each server, like CPU and RAM limits. I was using it only for personal purpose, and decied to share here. Hope you enjoy it.
×
×
  • Create New...