Jump to content

no suena la musica ni da problema al debug


iFoReX

Recommended Posts

Posted

no da ni problema ni nada. :P

lo Que queria que pasara era que al poner el cmd /play LINK nombre , era que se reproduciera el LINK, y en el outputchatbox apareciiera Reproduciendo : nombre :3 nose si me entienden

aqui el script :

cl-side

  
addEvent("triggear",true) 
addEventHandler("triggear",root, 
function(cancion,nombre) 
    setRadioChannel(0) 
    song = playSound(cancion,true) 
    outputChatBox("#48FF00##2E2E2EReproduciendo : #48FF00##2E2E2"..nombre,root,0,0,0,true) 
end 
) 
  
  
function toggleSong() 
    if not songOff then 
        setSoundVolume(song,0) 
        songOff = true 
        removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    else 
        setSoundVolume(song,1) 
        songOff = false 
        setRadioChannel(0) 
        addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    end 
end 
addCommandHandler("music",toggleSong) 

sv-side

addCommandHandler("play",function(playerSource,commandName,cancion,nombre) 
for k,v in ipairs(players) do 
accountname = getAccountName (getPlayerAccount(v)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then 
triggerClientEvent("triggear",playerSource,cancion,nombre) 
end 
end 
end 
) 
  

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

Cual es el problema?

P.D: Es "Admin" no "admin" con minuscula "a".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
for k,v in ipairs(players) do 

"players" no esta definido, pone esto:

for k,v in ipairs ( getElementsByType ( "player" ) ) do 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

ya arregle todo ... y asi me quedo

--------------------- 
---Script Echo por ElMota----- 
--------------------- 
  
  
addEvent("triggear",true) 
addEventHandler("triggear",root, 
function(cancion,nombre) 
    setRadioChannel(0) 
    stopSound(song) 
    setTimer(function() song = playSound(cancion,true) end,2000,1) 
    outputChatBox(" #48FF00##2E2E2EReproduciendo : #48FF00##2E2E2E"..nombre,0,0,0,true) 
end 
) 
  
  
function toggleSong() 
    if not songOff then 
        setSoundVolume(song,0) 
        songOff = true 
        removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    else 
        setSoundVolume(song,1) 
        songOff = false 
        setRadioChannel(0) 
        addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    end 
end 
addCommandHandler("music",toggleSong) 

addCommandHandler("play",function(playerSource,commandName,cancion,nombre) 
for k,v in ipairs(getElementsByType"player") do 
accountname = getAccountName (getPlayerAccount(v)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent("triggear",playerSource,cancion,nombre) 
end 
end 
end 
) 
  

tengo 1 problema, en mi server local funciona a la perfeccion, pero en el server hosteado se reproduce 2 veces a la vez la misma cancion :C

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

Cambia:

triggerClientEvent("triggear",playerSource,cancion,nombre) 

Por:

triggerClientEvent(v,"triggear",v,cancion,nombre) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Vos pusiste para que solo los admines pudieran escucharla.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Me parecia ami, pero bueh.

addCommandHandler ( "play", 
    function ( playerSource, commandName, cancion, nombre ) 
        if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( playerSource ) ), aclGetGroup ( "Admin" ) ) then 
            triggerClientEvent ( root, "triggear", root, cancion, nombre ) 
        end 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...