Andres Lahm

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Andres Lahm

  • Rank
    Vic
  1. Como lograr ├ęsto?

    Soy nuevo en esto pero creo que esto puede ayudarte https://wiki.multitheftauto.com/wiki/FadeCamera
  2. Ayuda

    Alguna funcion para convertir la url de youtube y que quede solo con la id del video ej: https:/ /www.youtube.com/watch?v=6biv8AQcjNU Y quede con la id : 6biv8AQcjNU
  3. [HELP] API for youtube

    playSound3D (" http://youtubeinmp3.com/fetch/?video="..url.."", x, y, z, true) stopped working a few months ago Any other API for youtube that is direct
  4. [Aporte] Carga de mapas .lua

    Link caido podrias subirlo de nuevo quiero probarlo
  5. API para youtube

    Bueno como dice el titulo del tema no sabes alguna otra api para youtube que no sea "http://www.youtubeinmp3.com/fetch/?video="..url.." Ya que esta dejo de funcionar alguna otra forma para poner links directos de youtube es para el playSound
  6. Ayuda con el parlante ya no funciona

    Bueno el parlante para escuchar musica con links directos de youtube ya no funciona, parece que la pagina ya no funciona. Nose si habra otra forma para reproducir links directos de youtube sin tener que convertirlos en mp3 Cliente: ------------------------------ -- Variables -- ------------------------------ local subTrackOnSoundDown = 0.1 -- The volume that goes down, when the player clicks "Volume -" local subTrackOnSoundUp = 0.1 -- The volume that goes up, when the player clicks "Volume +" function print ( message, r, g, b ) outputChatBox ( message, r, g, b ) end ------------------------------ -- The GUI -- ------------------------------ local rx, ry = guiGetScreenSize ( ) button = { } window = guiCreateWindow( ( rx - 295 ), ( ry / 2 - 253 / 2 ), 293, 253, "Panel Sound 3D", false) guiWindowSetSizable(window, false) guiSetVisible ( window, false ) CurrentSpeaker = guiCreateLabel(8, 33, 254, 17, "Parlante creado: No", false, window) volume = guiCreateLabel(10, 50, 252, 17, "Volumen: 100%", false, window) pos = guiCreateLabel(10, 66, 252, 15, "Buscar Link De :www.youtube.com", false, window) guiCreateLabel(11, 81, 251, 15, "URL:", false, window) --url = guiCreateEdit(11, 96, 272, 23, "", false, window) url = guiCreateEdit(11, 96, 272, 23, "", false, window) button["place"] = guiCreateButton(9, 129, 274, 20, "Crear Parlante", false, window) button["remove"] = guiCreateButton(9, 159, 274, 20, "Destruir Parlante", false, window) button["v-"] = guiCreateButton(9, 189, 128, 20, "Volumen -", false, window) button["v+"] = guiCreateButton(155, 189, 128, 20, "Volumen +", false, window) button["close"] = guiCreateButton(9, 219, 274, 20, "Salir", false, window) -------------------------- -- My sweet codes -- -------------------------- local isSound = false addEvent ( "onPlayerViewSpeakerManagment", true ) addEventHandler ( "onPlayerViewSpeakerManagment", root, function ( current ) local toState = not guiGetVisible ( window ) guiSetVisible ( window, toState ) showCursor ( toState ) if ( toState == true ) then guiSetInputMode ( "no_binds_when_editing" ) local x, y, z = getElementPosition ( localPlayer ) if ( current ) then guiSetText ( CurrentSpeaker, "Parlante creado: Si" ) isSound = true else guiSetText ( CurrentSpeaker, "Parlante creado: No" ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == button["close"] ) then guiSetVisible ( window, false ) showCursor ( false ) elseif ( source == button["place"] ) then if ( isURL ( ) ) then triggerServerEvent ( "onPlayerPlaceSpeakerBox", localPlayer, guiGetText ( url ), isPedInVehicle ( localPlayer ) ) guiSetText ( CurrentSpeaker, "Parlante creado: Si" ) isSound = true guiSetText ( volume, "Volumen: 100%" ) else print ( "Ingresa una URL", 255, 0, 0 ) end elseif ( source == button["remove"] ) then triggerServerEvent ( "onPlayerDestroySpeakerBox", localPlayer ) guiSetText ( CurrentSpeaker, "Parlante creado: No" ) isSound = false guiSetText ( volume, "Volumen: 100%" ) elseif ( source == button["v-"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) - subTrackOnSoundDown, 2 ) if ( toVol > 0.0 ) then print ( "Volumen Seteado a "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Volumen: "..math.floor ( toVol * 100 ).."%" ) else print ( "Este es el volumen minimo", 255, 0, 0 ) end end elseif ( source == button["v+"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) + subTrackOnSoundUp, 2 ) if ( toVol < 1.1 ) then print ( "Volumen Seteado a "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Volumen: "..math.floor ( toVol * 100 ).."%" ) else print ( "Este es el volumen maximo", 255, 0, 0 ) end end end end ) speakerSound = { } addEvent ( "onPlayerStartSpeakerBoxSound", true ) addEventHandler ( "onPlayerStartSpeakerBoxSound", root, function ( who, url, isCar ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end local x, y, z = getElementPosition ( who ) speakerSound [ who ] = playSound3D ( "http://www.youtubeinmp3.com/fetch/?video="..url, x, y, z, true ) setSoundVolume ( speakerSound [ who ], 1 ) setSoundMinDistance ( speakerSound [ who ], 15 ) setSoundMaxDistance ( speakerSound [ who ], 20 ) if ( isCar ) then local car = getPedOccupiedVehicle ( who ) attachElements ( speakerSound [ who ], car, 0, 5, 1 ) end end ) addEvent ( "onPlayerDestroySpeakerBox", true ) addEventHandler ( "onPlayerDestroySpeakerBox", root, function ( who ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end end ) -------------------------- -- Volume -- -------------------------- addEvent ( "onPlayerChangeSpeakerBoxVolumeC", true ) addEventHandler ( "onPlayerChangeSpeakerBoxVolumeC", root, function ( who, vol ) if ( isElement ( speakerSound [ who ] ) ) then setSoundVolume ( speakerSound [ who ], tonumber ( vol ) ) end end ) function isURL ( ) if ( guiGetText ( url ) ~= "" ) then return true else return false end end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end Servidor: local isSpeaker = false function print ( player, message, r, g, b ) outputChatBox ( message, player, r, g, b ) end speakerBox = { } addCommandHandler ( "sound", function ( thePlayer ) if ( isElement ( speakerBox [ thePlayer] ) ) then isSpeaker = true end triggerClientEvent ( thePlayer, "onPlayerViewSpeakerManagment", thePlayer, isSpeaker ) end ) addEvent ( "onPlayerPlaceSpeakerBox", true ) addEventHandler ( "onPlayerPlaceSpeakerBox", root, function ( url, isCar ) if ( url ) then if ( isElement ( speakerBox [ source ] ) ) then local x, y, z = getElementPosition ( speakerBox [ source ] ) print ( source, "Parlante Quitado.", 255, 0, 0 ) destroyElement ( speakerBox [ source ] ) removeEventHandler ( "onPlayerQuit", source, destroySpeakersOnPlayerQuit ) end local x, y, z = getElementPosition ( source ) local rx, ry, rz = getElementRotation ( source ) speakerBox [ source ] = createObject ( 2229, x-0.5, y+0.5, z - 1, 0, 0, rx ) print ( source, "Parlante Creado.", 0, 255, 0 ) addEventHandler ( "onPlayerQuit", source, destroySpeakersOnPlayerQuit ) triggerClientEvent ( root, "onPlayerStartSpeakerBoxSound", root, source, url, isCar ) if ( isCar ) then local car = getPedOccupiedVehicle ( source ) attachElements ( speakerBox [ source ], car, -0.7, -1.5, -0.5, 0, 90, 0 ) end end end ) addEvent ( "onPlayerDestroySpeakerBox", true ) addEventHandler ( "onPlayerDestroySpeakerBox", root, function ( ) if ( isElement ( speakerBox [ source ] ) ) then destroyElement ( speakerBox [ source ] ) triggerClientEvent ( root, "onPlayerDestroySpeakerBox", root, source ) removeEventHandler ( "onPlayerQuit", source, destroySpeakersOnPlayerQuit ) print ( source, "Parlante Quitado.", 255, 0, 0 ) else print ( source, "El Parlante Ya A Sido Quitado.", 255, 255, 0 ) end end ) addEvent ( "onPlayerChangeSpeakerBoxVolume", true ) addEventHandler ( "onPlayerChangeSpeakerBoxVolume", root, function ( to ) triggerClientEvent ( root, "onPlayerChangeSpeakerBoxVolumeC", root, source, to ) end ) function destroySpeakersOnPlayerQuit ( ) if ( isElement ( speakerBox [ source ] ) ) then destroyElement ( speakerBox [ source ] ) triggerClientEvent ( root, "onPlayerDestroySpeakerBox", root, source ) end end Bueno espero que podramos solucionarlo