Jump to content

Santi

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Santi

  1. Existe sim. Tem alguns exemplos de como aplicar isso para funções e eventos. https://wiki.multitheftauto.com/wiki/AddDebugHook
  2. I'm using it but the objects are becoming invisible or coming out of the bone. Edit: The server has more than 200 players. Then the objects leave the bone without explanation.
  3. https://wiki.multitheftauto.com/wiki/IsElementInWater
  4. What's up, Steve! About your interior customizing system. Did any Brazilian server bougth from you? If so, which ones?

    1. </Steve>

      </Steve>

      Please contact me in private message for further informations.

  5. Vai ter que ser algo mais ou menos isso: addEventHandler('onClientResourceStart', resourceRoot, function() local ped = createPed( id, x, y, z ) addEventHandler( 'onClientPedDamage', ped, function( attacker ) cancelEvent() end end Se quiser saber mais sobre, você pode ir na wiki. https://wiki.multitheftauto.com/wiki/OnClientPedDamage
  6. Isso ocorre muito por causa da sua conexão (provedor e etc) e também quando você usa alguma ferramenta de mudanças de rota como exitlag, noping, wtfast e por aí vai.
  7. Sem código, sem ajuda. Você deveria mostrar em qual parte do seu código acontece isso dos veículos e ser mais explícito em relação a sua lógica de raciocínio.
  8. Isso foi respondido há pouco tempo.
  9. Tente passar o fuel para tonumber(fuel) na linha 16
  10. You're posting this in the wrong session. This should be posted on the Portuguese forum. Lugar incorreto de postar, amigo. Você deveria na sessão em Português. https://forum.multitheftauto.com/forum/97-portuguese-português/
  11. O client trabalha para o servidor. Creio eu que a partir do momento que o server-side desliga, o client-side é desligado primeiro que ele porque o client-side só funciona se o server-side estiver ligado. Você bem que poderia salvar essa quilometragem quando o jogador sair do veículo no client. https://wiki.multitheftauto.com/wiki/OnClientPlayerVehicleExit
  12. function hex2rgb (hex) local hex = hex:gsub("#","") if hex:len() == 3 then return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255 else return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255 end end -- exemple usage: (NOT TESTED the command) but the function works fine addEventHandler("onPlayerCommand",root, function(command, player) if (command == "convert") then outputConsole("Result: " .. hex2rgb("#ffffff"),player) end end)
  13. Já existe sim. Se você procurar direitinho em sites como por exemplo o MTA Brasil ou algum outro site.
  14. 1° coloque a música para tocar assim que o jogador entra no servidor usando o evento: onPlayerJoin 2° retire a música assim que o jogador fazer login usando o evento: OnPlayerLogin Boa sorte. E veja alguns tutoriais aqui no fórum sobre Lua. Criar um servidor não é só montar peça por peça como um quebra cabeça. Você tem que se dedicar um pouco se quiser algo que realmente seja seu.
  15. Obrigado pela resposta. Fico grato. Eu tinha noção disso, porém em muitos códigos que vi, todos usam algo como uma proteção a mais. Uns para proteger seus resources e outros com outros métodos para meio que barrar alguns programas ilegais.
  16. A dúvida é bem simples. Quais cuidados eu devo tomar para preveni meu script em relação a bugs, desempenho ou até mesmo falhas que o player possa abusar. Por exemplo qual função devo evitar usar e coisas do tipo.
  17. No server use source invés de getRootElement() na hora de fazer trigger no client, ficando assim: addCommandHandler("coco",function(source) local x,y,z = getElementPosition(source) coco = createObject(14810,x,y-0.1,z-0.8,0,0,rotation) setTimer(destroyElement,900000,1,coco) triggerClientEvent("somcoco",source) setPedAnimation( source, "ped", "WEAPON_crouch", -1, false,false,nil,false ) end) addCommandHandler("tomacachaca",function(source) setPedAnimation( source, "VENDING", "VEND_Drink2_P", -1,false,false,nil,false ) triggerClientEvent("somcachaca",source) end)
  18. Já tentou algo como? Musica_AG = nil function AbrirAgenciaEmpregos () if AgenciaEmpregosAirNew == false then addEventHandler ( "onClientRender", root, PainelAgenciaEmpregosNew ) showCursor ( true ) AgenciaEmpregosAirNew = true Musica_AG = playSound("img/music.mp3",true) -- inicia musica ao abrir o painel da agencia showChat(false) -- desativa o chat enquanto o painel ta aberto end end addEvent ( "AirNew>AbrirAgencia", true) addEventHandler ( "AirNew>AbrirAgencia", root, AbrirAgenciaEmpregos ) function FecharAgenciaEmpregos () if AgenciaEmpregosAirNew == true then removeEventHandler ( "onClientRender", root, PainelAgenciaEmpregosNew ) showCursor ( false ) AgenciaEmpregosAirNew = false playSoundFrontEnd ( 40 ) stopSound(Musica_AG) --deveria parar a musica a o fecher a agencia showChat(true) --deveria mostrar o chat ao fechar a agencia end end addEvent ( "AirNew>FecharAgencia", true) addEventHandler ( "AirNew>FecharAgencia", root, FecharAgenciaEmpregos )
  19. Santi

    Unknow error

    When I click the button nothing happens. And when it works then the map bug. Solved! I was using sedPedSkin instead SetPlayerSkin
  20. Santi

    Unknow error

    -- server addEvent("Skins",true) addEventHandler("Skins",root,function() setPedSkin( source, 310 ) end) -- client triggerServerEvent ("Skins", getLocalPlayer(), Skins ) I tried many differents way to solve this. I just want to set player skin from client-side to server side
×
×
  • Create New...