-
Posts
23 -
Joined
-
Last visited
Everything posted by Santi
-
Existe sim. Tem alguns exemplos de como aplicar isso para funções e eventos. https://wiki.multitheftauto.com/wiki/AddDebugHook
-
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.
-
https://wiki.multitheftauto.com/wiki/IsElementInWater
-
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
-
ERRO RADIO MUDO HEEELP
Santi replied to SrAlexz's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
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. -
Não.
- 1 reply
-
- 1
-
-
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.
-
Isso foi respondido há pouco tempo.
-
Criação de script para animação em conjunto com outro player
Santi replied to Dadinho's topic in Programação em Lua
Vai acompanhando isso -
Tente passar o fuel para tonumber(fuel) na linha 16
-
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/
-
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
- 1 reply
-
- 1
-
-
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)
-
Já existe sim. Se você procurar direitinho em sites como por exemplo o MTA Brasil ou algum outro site.
-
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.
-
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.
-
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.
-
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)
-
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 )
-
When I click the button nothing happens. And when it works then the map bug. Solved! I was using sedPedSkin instead SetPlayerSkin
-
-- 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