Jump to content

DNL291

Retired Staff
  • Posts

    3,875
  • Joined

  • Days Won

    67

Everything posted by DNL291

  1. Try setCameraClip
  2. Tem que editar a anim e tirar o movimento/frames (pegue a crry_prtial como exemplo), nunca fiz mas deve funcionar.
  3. Seta interior 0, no carro e no player. Também, mude o nome da função getPlayerSkin na linha 3 para getElementModel. getPlayerSkin é uma função obsoleta que só existe hoje por conta de compatibilidade para versões antigas.
  4. Tópico trancado. @pitu_beats só postar no tópico linkado pelo Jonas^.
  5. Substitua client por source.
  6. Algum script tá ativando, procure no script e remova (setPlayerHudComponentVisible).
  7. Cria o ped client-side.
  8. setPlayerVoiceBroadcastTo ( thePlayer, broadcastTo ) thePlayer: O player o qual o voice vai ser setado broadcastTo: Um player/team ou uma table de com os elements que irão ouvir o thePlayer Edit: pra setar o volume use setSoundVolume no jogador
  9. local fps = false local function updateFPS(msSinceLastFrame) -- FPS are the frames per second, so count the frames rendered per milisecond using frame delta time and then convert that to frames per second. fps = (1 / msSinceLastFrame) * 1000 end addEventHandler("onClientPreRender", root, updateFPS) addEventHandler( "onClientRender", root, function() dxDrawText( "FPS: ".. (fps or "N/A"), 1122, 188, 1228, 205, tocolor(255, 255, 255, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) end )
  10. DNL291

    Admin panel

    That means your ped has not been spawned, make sure that resource play is running. Edit: Read https://wiki.multitheftauto.com/wiki/Resources and https://wiki.multitheftauto.com/wiki/Scripting_Introduction
  11. Parece relacionado com isto: https://github.com/multitheftauto/mtasa-blue/issues/1019#issuecomment-508185882 Tente seguir as etapas no link acima e veja se corrige o problema.
  12. https://wiki.multitheftauto.com/wiki/GetCurrentFPS Tá aí, só copiar o código da função no seu script e usar a função dentro do dxDrawText.
  13. Sim, use setVehiclePlateText quando o jogador comprar o veículo. No onPlayerLogout/onPlayerQuit: getVehiclePlateText, obtendo todos veículos do jogador que saiu e setAccountData (se não tiver uma database), mas recomendo fazer isso com um banco de dados, função dbExec.
  14. Substitua 'pAccount' com getAccountName(pAccount)
  15. ME LEIA POR FAVOR
  16. Cole aqui seu código com a devida formatação, não vamos ficar baixando arquivos para vê-los. Ontopic: Não tá correto, tem erro até no meta.xml.
  17. "args" vai retornar uma tabela com os parâmetros passados. Esse código você só vai colar dentro do seu script, só chame a função setPedFreezedAnimation: local pedsAnim = {} function setPedFreezedAnimation( ... ) local args = { ... } function animRender( ped ) setPedAnimationProgress( ped, args[3], .1 ) end if setPedAnimation( ... ) then if #args == 1 then if pedsAnim[ args[1] ] then if isTimer(pedsAnim[ args[1] ]) then killTimer(pedsAnim[ args[1] ]) end pedsAnim[ args[1] ] = nil end elseif #args >= 3 then pedsAnim[ args[1] ] = setTimer ( animRender, 20, 0, args[1] ) end end end Atualizei o código. Você vai precisar parar chamando novamente, aqui está um código completo com um comando para a anim pra parar a anim: addCommandHandler( "animstart", function(p) setPedFreezedAnimation( p, "kissing", "gift_give", -1, false, false, false ) end) addCommandHandler( "animstop", function(p) setPedFreezedAnimation( p ) end) local pedsAnim = {} function setPedFreezedAnimation( ... ) local args = { ... } function animRender( ped ) setPedAnimationProgress( ped, args[3], .1 ) end if setPedAnimation( ... ) then if #args == 1 then if pedsAnim[ args[1] ] then if isTimer(pedsAnim[ args[1] ]) then killTimer(pedsAnim[ args[1] ]) end pedsAnim[ args[1] ] = nil end elseif #args >= 3 then pedsAnim[ args[1] ] = setTimer ( animRender, 20, 0, args[1] ) end end end addEventHandler( "onPlayerQuit", root, function() if pedsAnim[source] then if isTimer(pedsAnim[source]) then killTimer(pedsAnim[source]) end pedsAnim[source] = nil end end ) Corrigi pra parar o timer quando para a animação e adicionai isso no "onPlayerQuit". Eu tentei fazer alguns esquemas mas não funciona, provavelmente funcionou depois de você ter tentando uma vez e esperar a anim terminar, daí se fizer de novo "funciona". Só vai funcionar de verdade setando o progresso da anim com um timer.
  18. function isPlayerInSA( p ) local px, py = getElementPosition(p) return ( ( px <= 3000 and px >= -3000 ) and ( py <= 3000 and py >= -3000 ) ) end
  19. function setPedFreezedAnimation( ... ) local args = { ... } function animRender( ped ) setPedAnimationProgress( ped, args[3], .1 ) setTimer( animRender, 50, 1, ped ) end setPedAnimation( ... ) setTimer ( animRender, 50, 1, args[1] ) end Apenas substitua os nomes, sePedAnimation com o da função acima. Lua vai interpretar como 0.1, o valor assim também é aceito. Por exemplo, .199 será o mesmo que 0.199
  20. local theShape = getElementColShape( pickup ) isElementWithinColShape( thePlayer, theShape ) Não precisa dessa função, só usar isso ^
  21. Sim, infelizmente esse é um problema do MTA. Mas é possível fazer andar com animação sem frames/movimentos.
  22. Já fez um teste com apenas 1 resource no server pra ver se ele funciona? Isso é bem provável que seja um script causando.
  23. https://community.multitheftauto.com/index.php?p=resources&s=list&name=downloader&descr=&category= Just edit them to make the changes according to your needs.
  24. This code doesn't seem to make sense, what are you trying to achieve?
×
×
  • Create New...