Jump to content

+Sommer

Members
  • Posts

    47
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

+Sommer's Achievements

Rat

Rat (9/54)

0

Reputation

  1. Agora sim funcionou perfeitamente, muito obrigado mesmo principe, aprendi funções e ordens q nunca tinha usado com isso, obrigado mesmo de vdd
  2. Certo, perfeito até demais kakakaka muito obrigado de vdd, depois disso eu so estou tendo o ultimo problema pode me dar uma direção de onde estou errando? a musica esta aleatoria mas somente quando eu dou start ou restart no resource, mesmo eu colcocando uma função para quando a musica parar, nesse link tem um exemplo https://www.upload.ee/image/16342877/duvida.png
  3. Tentei da forma como colocou e sem sucesso, ele nao executa o fade e quando executou a proxima musica nao foi tocada ou toca a mesma musica repetidamente, posso estar utilizando de maneira incorreta? tentei separadamente como mandou e tentei desse jeito, teria outro metodo, pois em um futuro irei colocar o nome da musica q esta sendo tocada, ent precisava q a proxima musica tocasse nao repetidamente mas de forma aleatoria e com precisao para colocar o nome, maneira q tentei: local playlist = { {"playlist/1.mp3", "EDEN - Drugs"}, {"playlist/2.mp3", "Fukkit - Kiwi"}, {"playlist/3.mp3", "Lilbubblegum x Letoa - Guap"}, {"playlist/4.mp3", "Luh Kel - How to love"}, {"playlist/5.mp3", "Second Time - Style aomine"}, {"playlist/6.mp3", "Thareapa - Bad spin"} } local random = math.random(1, #playlist) addEventHandler("onClientResourceStart", getResourceRootElement(), function() local sound = playSound(playlist[random][1], false) addEventHandler("onClientSoundBeat", getResourceRootElement(), function(time) if time > getSoundLength(source) - 5 then stopSoundSlowly(source) end addEventHandler("onClientSoundStopped", getResourceRootElement(), function(reason) if ( reason == "finished" ) then playSound(playlist[random][1], false) end end) end) end) -- Login UI -- -- ## Scripts Auxiliares ## -- function stopSoundSlowly( sound_element ) if not isElement( sound_element ) then return false end local sound_timer_quant = getSoundVolume( sound_element ) setTimer( function( ) if not isElement( sound_element ) then return end local sound_volume = getSoundVolume( sound_element ) sound_volume = ( ( sound_volume * 10 ) - ( 0.1 * 10 ) ) / 10 setSoundVolume( sound_element, sound_volume - 0.1 ) if sound_volume > 0 then return end stopSound( sound_element ) end, 500, sound_timer_quant * 10 ) end
  4. Fala rapaziada blz, estou tentando fazer um sistema que utiliza musicas, mas queria fazer um esquema de toda vez que uma musica acabar antes de entrar a outra rolar um fade out, tentei utilizar um setTimer ma snao deu certo apaguei procurei um pouco e achei uma função util, tentei fazer da maneira que esta ai, mas sem sucesso tbm, creio que terei que pegar o tamanho do som/musica e setar algum limite pra ele e quando isso acontecer setar = 0, na logica creio q é isso, mas n sei como aplicar, se alguem puder dar uma luz agradeço, segue o codigo atual local playlist = { "playlist/1.mp3", "playlist/2.mp3", "playlist/3.mp3", "playlist/4.mp3", "playlist/5.mp3", "playlist/6.mp3" } addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() local sound = playSound(playlist[math.random(#playlist)], false) addEventHandler("onClientSoundStopped", getRootElement(), function(reason) if sound and reason == "finished" then playSound(playlist[math.random(#playlist)], false) else local volume = getSoundVolume(sound) if volume == true then return else stopSoundSlowly(sound) end end end) end) -- ## Scripts Auxiliares ## -- function stopSoundSlowly( sound_element ) if not isElement( sound_element ) then return false end local sound_timer_quant = getSoundVolume( sound_element ) setTimer( function( ) if not isElement( sound_element ) then return end local sound_volume = getSoundVolume( sound_element ) sound_volume = ( ( sound_volume * 10 ) - ( 0.1 * 10 ) ) / 10 setSoundVolume( sound_element, sound_volume - 0.1 ) if sound_volume > 0 then return end stopSound( sound_element ) end, 500, sound_timer_quant * 10 ) end
  5. olha cara meu script esta assim do lado client: -- Esala para outros monitores local screenWidth, screenHeight = guiGetScreenSize() local x, y = (screenWidth/1440), (screenHeight/900) -- Painel login em DX function dxUI() dxDrawImage(0, 0, x*1440, y*900, 'images/background.jpg', 0, 0, 0, tocolor(255, 255, 255, 255)) end -- Renderiza a UI do painel e suas funções do lado servidor function renderUI() --addEventHandler('onClientRender', getRootElement(), dxUI) end addEvent('render_UI', true) addEventHandler('render_UI', resourceRoot, renderUI) -- Efeito Fade-In no Background e assim do lado server: -- Cria o marker para que a pessoa acesse o painel de login local loginMarker = createMarker(2245.528, -1260.809, 22.5, 'cylinder', 1.5, 255, 255, 255, 50) -- Abre o painel de login e as outras funções para o player addEventHandler('onMarkerHit', loginMarker, function(thePlayer) local elementType = getElementType(thePlayer) if (elementType) == 'player' then -- confirma se quem realmente esta acessando o painel é um player triggerClientEvent(thePlayer, 'render_UI', resourceRoot, true) end end ) Ali no lado client eu visto em outros lugares do forum e vi de um jeito que quando vc apertava a tecla ele fazia o fade in e quando vc apertava dnv ele fazia o fade out, so como quero renderizar uma imagem eu tinha mudado um pouco e feito mais ou menos assim: mas nao obtive sucesso, eu queria utilizar o interpolate pois creio que fique mais facil de manipular e mais otimizado por mais que sou iniciante queria ja pensar na otimização de alguns efeitos que sejam 'simples' de fazer, mas nao tenho ideia de como utilizar o interpolate para criar esse fade quando hitar o marker -- Esala para outros monitores local screenWidth, screenHeight = guiGetScreenSize() local x, y = (screenWidth/1440), (screenHeight/900) -- Painel login em DX function dxUI() dxDrawImage(0, 0, x*1440, y*900, 'images/background.jpg', 0, 0, 0, tocolor(255, 255, 255, alp)) end -- Renderiza a UI do painel e suas funções do lado servidor function renderUI() addEventHandler('onClientRender', getRootElement(), dxUI) end addEvent('render_UI', true) addEventHandler('render_UI', resourceRoot, renderUI) -- Efeito Fade-In no Background alp = 255 function bindMenu() if showMenu == false then addEventHandler("onClientRender", root, showMenu) setTimer(function() if alp == 254 then showMenu = true end alp = alp + 1 end,50,255) else setTimer(function() if alp == 1 then removeEventHandler("onClientRender", root, showMenu) showMenu = false end alp = alp - 1 end,50,255) end end
  6. Eae rapaziada, estava fazendo um script e queria fazer um efeito de Fade In em uma imagem, porem esse efeito, essa imagem so deve aparecer após hitar um marker, estava tentando usar a função interpolateBetween junto com alguns timers mas sem sucesso, dei uma procurada no forum consegui fazer com que o fade funcionasse caso uma bind fosse acionada, mas nao consigo aplicar assim que player acerta o marker, podem me dar uma direção ou algum link que possa me ajudar pfv
  7. Eae rapaziada, tava fazendo um painel de login aqui e ele ta todo funcional já, só que tem um probleminha que ta tenso, não to conseguindo achar onde está errado. ---------- client.lua ---------- local sW, sH = guiGetScreenSize() loadstring(exports.dgs:dgsImportFunction())() DGS = { e = {} } color = {} addEventHandler("onClientResourceStart", resourceRoot, function() DGS.e[1] = dgsCreateEdit(0.42, 0.47, 0.16, 0.04, "", true) dgsSetAlpha(DGS.e[1], 0.75) dgsSetProperty(DGS.e[1], "NormalTextColour", "FE000000") dgsSetProperty(DGS.e[1], "font", "default-bold") DGS.e[2] = dgsCreateEdit(0.42, 0.55, 0.16, 0.04, "", true) dgsSetAlpha(DGS.e[2], 0.75) dgsSetProperty(DGS.e[2], "NormalTextColour", "FE000000") dgsSetProperty(DGS.e[2], "font", "default-bold") end) function dxLogin() dxDrawRectangle(sW * 0.3806, sH * 0.2167, sW * 0.2396, sH * 0.5678, tocolor(25, 30, 40, 160), false) dxDrawRectangle(sW * 0.3806, sH * 0.2156, sW * 0.2396, sH * 0.0833, tocolor(25, 40, 100, 100), false) dxDrawText("ATLANTIC © 2021", sW * 0.3806, sH * 0.2156, sW * 0.6201, sH * 0.2978, tocolor(200, 200, 200, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(sW * 0.3806, sH * 0.2989, sW * 0.2396, sH * 0.0044, tocolor(0, 0, 0, 180), false) color[1] = tocolor(200, 200, 200, 255) if cursorOnPosition(sW * 0.3875, sH * 0.6778, sW * 0.1042, sH * 0.0956) then color[1] = tocolor(0, 255, 0, 255) end dxDrawRectangle(sW * 0.3875, sH * 0.6778, sW * 0.1042, sH * 0.0956, tocolor(70, 75, 83, 175), false) -- Botão login color[2] = tocolor(200, 200, 200, 255) if cursorOnPosition(sW * 0.5090, sH * 0.6778, sW * 0.1042, sH * 0.0956) then color[2] = tocolor(255, 0, 0, 255) end dxDrawRectangle(sW * 0.5090, sH * 0.6778, sW * 0.1042, sH * 0.0956, tocolor(70, 75, 83, 175), false) -- Botão register dxDrawText("USER :", sW * 0.4229, sH * 0.4267, sW * 0.5035, sH * 0.4611, tocolor(155, 155, 155, 200), 1.00, "default-bold", "left", "bottom", false, false, false, false, false) dxDrawText("REGISTER :", sW * 0.4229, sH * 0.5100, sW * 0.5035, sH * 0.5444, tocolor(155, 155, 155, 200), 1.00, "default-bold", "left", "bottom", false, false, false, false, false) dxDrawText("Login", sW * 0.3875, sH * 0.6778, sW * 0.4917, sH * 0.7733, color[1], 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Create Account", sW * 0.5090, sH * 0.6778, sW * 0.6132, sH * 0.7733, color[2], 1.20, "default-bold", "center", "center", false, false, false, false, false) showCursor(true) addEventHandler('onClientClick', root, function(btn, state) if btn == 'left' and state == 'down' then if cursorOnPosition(sW * 0.3875, sH * 0.6778, sW * 0.1042, sH * 0.0956) then local g_user, g_pass = dgsGetText(DGS.e[1]), dgsGetText(DGS.e[2]) triggerServerEvent('playerRequestLog', getLocalPlayer(), g_user, g_pass) end end end) end addEventHandler('onClientRender', root, dxLogin) addEvent('playerLogged', true) function playerLogged() removeEventHandler('onClientRender', root, dxLogin) destroyElement(DGS.e[1]) destroyElement(DGS.e[2]) showCursor(false) end addEventHandler('playerLogged', getRootElement(), playerLogged) addEvent('playerRegisterSucess', true) function playerRegisterSucess() destroyElement(GUI.window[2]) end addEventHandler('playerRegisterSucess', getRootElement(), playerLogged) function cursorOnPosition(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local sx, sy = guiGetScreenSize() local cx, cy = (mx*sx), (my*sy) if (cx > x and cx < x + w) and (cy > y and cy < y + h) then return true else return false end end Creio que seja no client mas, vou colocar aqui o lado server tbm: ---------- server.lua ---------- addEvent('playerRequestLog', true) function playerRequestLog(user, pass) if not(user == '') then if not(pass == '') then local account = getAccount(user, pass) if not account then outputChatBox('ERROR: Está conta não existe.', source, 255, 0, 0) else logIn(source, account, pass) triggerClientEvent(source, 'playerLogged', source) outputChatBox('Logado com sucesso. =)', source, 0, 255, 255) end else outputChatBox('Insira uma senha.', source, 255, 0, 0) end else outputChatBox('Insira um username.', source, 255, 0, 0) end end addEventHandler('playerRequestLog', getRootElement(), playerRequestLog) addEvent('playerRequestRegister', true) function playerRequestRegister(reguser, regpass) if not(reguser == '') then if not(regpass == '') then local account = getAccount(reguser, regpass) if (account) then outputChatBox('ERROR: Está conta já existe, insira outro username e senha.', source, 255, 0, 0) else addAccount(reguser, regpass) outputChatBox('Registrado com sucesso, faça o login agora.', source, 0, 255, 255) triggerClientEvent(source, 'playerRegisterSucess', source) end else outputChatBox('Insira uma senha.', source, 255, 0, 0) end else outputChatBox('Insira um username.', source, 255, 0, 0) end end addEventHandler('playerRequestRegister', getRootElement(), playerRequestRegister) O Erro é o seguinte, quando o player não digitar um campo, ou a não existir ele emite um texto no chat(futuramente farei menssagens, é só para teste), só que ta repetindo as frases e muito papo de floodar o chat da um ligo: https://imgur.com/a/S3qPhVk Se poderem me ajudar ai fico grato s2
  8. Sim man por se falar em video ainda mais que eu vou colocar um video de 2 horas kkkkk, mas obrigado + uma vez
  9. I caramba n pensei nisso, vou testar aq, LORD HENRY! Tu é um gênio muito obrigado ?, agora n desisto mais, vlw mesmo man
  10. Certo mas que nem eu disse ali em cima, está função crasha meu MTA, e no caso acho que vou ter que abandonar está função pois estava testando aq ela não tem como criar um retangulo ou algo do tipo por cima do video que era oque eu queria fazer, mas se alguem tiver alguma solução milagrosa ai para me ajudar agradeceria muito... e muito obrigado a quem me ajudou neste tópico aq
  11. Até ? Temos outro problema aq mesmo assunto kkkkkk, no meu pensamento era colocar um video no fundo e fazer o login por cima, mas aconteceu o contrario o video esta por cima do login, sabe como fazer ele ir para tras? e deixar todos os Dx's na frente (OBS: Tentei trocar a função de posição, mas...)
  12. kkkk funcionou , era só apagar está parte do link 5wbHuqYKODo que no caso é o link do video ex: youtube.com/watch?v=S0kWGy_XfMI era só colocar esse codigo depois do = vlw ae man + uma vez tu salvou minha pele ?
  13. Esse link funcionou abriu em tela cheia já, so vou ver isso que tu falou como gerar esse tipo de link
×
×
  • Create New...