Jump to content

DNL291

Moderators
  • Posts

    3,875
  • Joined

  • Days Won

    67

Everything posted by DNL291

  1. Eu me equivoquei ali onde disse do text de sombra. Aqueles dos ifs v.Type pelo que entendi vão fazer mostrar algum carácter/símbolo.
  2. Moved to Scripting: https://forum.multitheftauto.com/forum/71-scripting/ You can replace vehicle paintjob with shader @Andrew75t
  3. Olá e bem-vindo ao fórum. Para manter o local organizado temos os respectivos sub-fóruns, por isso, sempre que criar um tópico por favor crie-o dentro do sub-fórum Portuguese / Português Você pode encontrá-lo pela página inicial do fórum da forma mostrada abaixo: Isso evitará o trabalho que os moderadores têm diariamente de mover posts para os locais certos. Sempre que criar um novo tópico, certifique-se que esteja na devida categoria. No sub-fórum Português ficam todas postagens na linguagem portuguesa, enquanto que fora da categoria Other languages só é permitido posts em inglês, por isso, sempre que responder um tópico, preste atenção a isso. Tópico: addCommandHandler setElementData Movido para: https://forum.multitheftauto.com/forum/127-programação-em-lua/ @s0ouz4
  4. O dx-text da mensagem é o da linha 87, coloque true depois do último argument.
  5. O seu código também, falta limitar para o horário certo que dei no meu feedback. Eu testei o código do \\Virus// e funcionou aqui, provavelmente você errou na criação do meta/resource.
  6. Falta colocar na condição dos minutos se a hora é diferente de 24, senão vai setar 00:minutos com 24h + minutos o que não faz sentido - Na verdade, o limite correto é 23:59, pois 00:00 já será permitido pelo comando.
  7. Veja se o resource está funcionando e sem erros. Inicie o resource e digite o comando debugscript 3. Com o resource funcionando, digite o comando do script seguido das sintaxes (/hora <hora> <minuto>).
  8. Você pode procurar pelo resource aqui: https://community.multitheftauto.com/ Se for mod, não tem nada a ver com o MTA, você precisa instalar na pasta do GTA.
  9. O dx-text de sombra você precisa remover os códigos. O atributo colorCoded=true será nos dx-texts abaixo. Tente isto: local displayWidth, displayHeight = guiGetScreenSize(); local notificationData = {}; local notificationFont = dxCreateFont('font/roboto.ttf', 12 * 2, false); local iconsFont = dxCreateFont('font/icons.ttf', 12 * 2, false); addEventHandler('onClientRender', root, function() for k, v in pairs(notificationData) do if (v.State == 'fadeIn') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 255; end if (alphaProgress > 1) then v.Tick = getTickCount(); v.State = 'openTile'; end elseif (v.State == 'fadeOut') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 0; end if (alphaProgress > 1) then notificationData = {}; end elseif (v.State == 'openTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end if (tileProgress > 1) then v.State = 'fixTile'; setTimer(function() v.Tick = getTickCount(); v.State = 'closeTile'; end, string.len(v.Text) * 45 + 5000, 1); end elseif (v.State == 'closeTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.StartX; v.CurrentWidth = 0; end if (tileProgress > 1) then v.AlphaTick = getTickCount(); v.State = 'fadeOut'; end elseif (v.State == 'fixTile') then v.Alpha = 255; v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true); dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true); if (v.Alpha == 255) then dxDrawText(removeHex(v.Text), v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', false, false, true); end if (v.Type == 'error') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true, true); elseif (v.Type == 'warning') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true, true); elseif (v.Type == 'info') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true, true); elseif (v.Type == 'success') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(235, 154, 13, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true, true); end end end ) addEvent('addNotification', true); function addNotification(text, type) if (text and type) then if (notificationData ~= nil) then table.remove(notificationData, #notificationData); end table.insert(notificationData, { StartX = (displayWidth / 2) - (25 / 2), EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2), Text = text, Width = dxGetTextWidth(text, 0.40, notificationFont) + 20, Alpha = 0, State = 'fadeIn', Tick = 0, AlphaTick = getTickCount(), CurrentX = (displayWidth / 2) - (25 / 2), CurrentWidth = 0, Type = type or 'info' } ); playSoundFrontEnd(11); end end addEventHandler('addNotification', root, addNotification); function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end dxDrawRectangle(x, y, w, h, bgColor, postGUI); dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); end end function removeHex (s) if type (s) == "string" then while (s ~= s:gsub ("#%x%x%x%x%x%x", "")) do s = s:gsub ("#%x%x%x%x%x%x", "") end end return s or false end
  10. O evento só vai ser chamado no client. Esse triggerEvent deve estar também. A linha do triggerEvent com o targetPlayer que fiz foi só como um exemplo, você precisa armazenar o elemento. Sim, vai chamar para todos os clientes. O targetPlayer (jogador que irá escutar o que deu o comando) pode ser armazenado com setElementData (útil se você precisar obtê-lo no lado server); Ou numa variável.
  11. localPlayer representa o jogador local; ou seja, o jogador local pode ser qualquer um cliente (se você já tem um entendimento sobre client-server vai entender melhor). localPlayer pode ser qualquer um jogador, e aquele código 'pertence' a ele, porque os clientsides executam individualmente. Outros jogadores não existem no ambiente de tal cliente, podem ser acessados apenas como jogadores remotos. Falando sobre a condição: agora que está esclarecido, você deve entender que isso irá verificar se o jogador local é aquele que foi especificado no comando /voice, se não for, a transmissão de voz é desativada.
  12. Tem um resource que vem na instalação do MTA chamado headshot. Você também pode procurar aqui: https://community.multitheftauto.com/
  13. Você pode tentar o seguinte: triggerEvent( "onClientPlayerVoiceStart", localPlayer, targetPlayer ) localPlayer : O jogador que começou falar; source do evento. targetPlayer : O jogador que deverá ouvir o source do evento. Fazendo o cancelamento para outros jogadores: addEventHandler("onClientPlayerVoiceStart", root, function( targetPlayer ) if targetPlayer and localPlayer ~= targetPlayer then cancelEvent() end end) A função triggerEvent você usa na sua função do comando. É uma forma paralela à padrão do voice para forçar a voz no modo ativado. Para forçar a voz desativada faça o trigger com onClientPlayerVoiceStop Não cheguei a testar se tudo isso funciona, só a parte do triggerEvent.
  14. Editbox cegui? Se for aqui está as propriedades: http://static.cegui.org.uk/static/WindowsLookProperties.html#Editbox (Se for gui-Label: https://wiki.multitheftauto.com/wiki/Client_Scripting_Functions#Text_Labels) Centralizar: "HorizontalAlignment" Cor: "NormalTextColour"; "InactiveSelectionColour"; "SelectedTextColour" Nunca testei algumas dessas propriedades, faça o teste e veja.
  15. Moved to Scripting section: https://forum.multitheftauto.com/forum/71-scripting/
  16. Add the player to a table index and remove it inside setTimer, then you will have check if the player element is in the table at the beginning of your function. Another way is to store getTickCount() in player's index, then calculate the elapsed time with getTickCount() - stored tickCount of player's index.
  17. Colocando resource.admin no grupo Admin já deveria funcionar, senão a sua ACL ainda está com problemas.
  18. Pode ser que o nome do resource admin esteja diferente. Se tiver, renomeie para admin. Se não for isso, baixe o resource admin original e substitua.
  19. Please download and run MTADiag and follow the instructions. Post any Pastebin URL MTADiag gives you in a new topic you'll create at https://forum.multitheftauto.com/forum/83-client/, after which support can be offered.
  20. Digite no Console do servidor o comando info admin e verifique se está tudo ok Certifique-se de estar logado no servidor e digite start, se mostrar ACL: Access denied for 'start' significa que a sua conta não está na ACL. Pode ser também que a sua ACL esteja com problemas - você pode obter a versão atual desse arquivo aqui: https://github.com/multitheftauto/mtasa-blue/blob/master/Server/mods/deathmatch/acl.xml. Edit: você mandou o vídeo depois que postei aqui; No seu caso você realmente possui acesso ao painel, o problema é provavelmente com permissões do resource admin ou o próprio resource com problemas. Você pode descobrir mais olhando o seu console quando tentar iniciar algum resource. De qualquer forma, recomendo que faça o que eu disse acima e obtenha o acl.xml original.
  21. Por favor, use este local apenas para coisas relacionadas a scripts. Para reportar isso você deve postar aqui: https://forum.multitheftauto.com/forum/156-private-bugs/
  22. Não existe uma forma de desconectar o jogador via script, mas você pode dar kick no jogador para fazer isso.
  23. Você pode encontrar esse resource aqui: https://community.multitheftauto.com/
  24. Você pode definir uma variável no evento onPlayerWasted e passar nil/false quando spawnar (onPlayerSpawn).
×
×
  • Create New...