Alexs Posted June 27, 2012 Posted June 27, 2012 Miren, hice este script: function musicambientalfunc ( modo ) local encendida = getElementData ( localPlayer, "musica.on" ) if (encendida) then if ( modo == 1 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 2 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 3 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 4 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 5 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == off ) and ( encendida == true ) then stopSound(musicambiental) setElementData ( localPlayer, "musica.on", false ) end end end addCommandHandler ( "ambiente", musicambientalfunc ) function dejarenoffalspawn ( ) setElementData ( localPlayer, "musica.on", false ) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), dejarenoffalspawn ) No funciona, al escribir /ambiente 1 no suena nada, pero el debugscript no dice nada, que esta mal? Developer @ MYVAL
Castillo Posted June 27, 2012 Posted June 27, 2012 function musicambientalfunc ( _, modo ) local encendida = getElementData ( localPlayer, "musica.on" ) if (encendida) then if ( modo == 1 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 2 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 3 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 4 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == 5 ) and ( encendida == false ) then local musicambiental = playSound("Bruzko - El frio - [url=http://www.HHGroups.com.mp3]www.HHGroups.com.mp3[/url]") setElementData ( localPlayer, "musica.on", true ) elseif ( modo == off ) and ( encendida == true ) then stopSound(musicambiental) setElementData ( localPlayer, "musica.on", false ) end end end addCommandHandler ( "ambiente", musicambientalfunc ) function dejarenoffalspawn ( ) setElementData ( localPlayer, "musica.on", false ) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), dejarenoffalspawn ) El primer argumento de addCommandHandler client side es el nombre del comando que usaste. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted June 27, 2012 Author Posted June 27, 2012 Lo puse asi mismo, sin cambiar nada, me asegure 2 veces de todo, que la cancion se llame como el archivo y este igual en el mtea.xml, pero nada, el debugscript tampoco dice nada Developer @ MYVAL
Castillo Posted June 27, 2012 Posted June 27, 2012 No se si podes usar espacios en los archivos. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted June 27, 2012 Author Posted June 27, 2012 No, pero ya intente sacandoselos, me decia error HTTP si lo intentaba con los espacios. Developer @ MYVAL
CheiN Posted June 27, 2012 Posted June 27, 2012 no entendí pero creo que en vez de poner http://www.hhgroups.com pones esto: http://www.hhgroups.com.mp3 My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Alexs Posted June 27, 2012 Author Posted June 27, 2012 Al descargar el archivo se llama "Artista-Cancion-Pagina", no es que la intente reproducir desde la web. Developer @ MYVAL
CheiN Posted June 28, 2012 Posted June 28, 2012 ya intentaste playSound (music.mp3) My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
iFoReX Posted June 28, 2012 Posted June 28, 2012 Mr.Domo a eso le falta el string, alexs y si le cambias el nombre a la cancion ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
CheiN Posted June 28, 2012 Posted June 28, 2012 ya vi que wtf paso.... no cerraste los mil ends de todos los functions ifs elses thens debes cerras! My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Alexs Posted June 28, 2012 Author Posted June 28, 2012 Estan los "end" 1 por el if, uno por las functions y otro por el if y elseif. Developer @ MYVAL
iFoReX Posted June 29, 2012 Posted June 29, 2012 Mr.Domo estan bien los ends no tienen nada que ver con el error del script elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
CheiN Posted June 29, 2012 Posted June 29, 2012 .com.mp3 no es un formato de sonido para lua -.- solo mp3 playSound (nombredelarchivo.mp3) My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Alexs Posted June 29, 2012 Author Posted June 29, 2012 Jamas habia visto extensiones con 2 puntos, .mp3 es el archivo, .com es parte del nombre e.e y LUA acepta variados formatos... Developer @ MYVAL
iFoReX Posted June 29, 2012 Posted June 29, 2012 Ademas Mr.Domo eso no funcionaria faltan los strings elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
CheiN Posted June 29, 2012 Posted June 29, 2012 cambia el nombre a: playSound (music2.mp3) cambialo a music2.mp3 -.- intenta My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Alexs Posted June 29, 2012 Author Posted June 29, 2012 emmm.... crees que no lo intente, creo que es una obviedad que solo postearia un problema cuando ya intente arreglandolo y esa ayuda esta mal, te faltan los strings. Developer @ MYVAL
iFoReX Posted June 29, 2012 Posted June 29, 2012 Porque pones esto Mr.Domo ( -.- ) ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Alexs Posted June 29, 2012 Author Posted June 29, 2012 Off Topic: A mi tambien me molesta On Topic: el ElementData esta bien usado, verdad? Developer @ MYVAL
Recommended Posts