Arsilex Posted September 1, 2012 Share Posted September 1, 2012 Por que no me funciona esto function M5 (thePlayer) local vehicle = getPedOccupiedVehicle ( localPlayer ) local x,y,z = getElementPosition( vehicle ) local collision = createColSphere ( x, y, z, 10.0 ) local playersincol = getElementsWithinColShape( collision, "player" ) stopSound( sound ) for theKey,localPlayer in ipairs(playersincol) do sound = playSound3D( "http://listen.radionomy.com/abc-dance.m3u", x, y, z, true ) setSoundVolume( sound, 5 ) setSoundMaxDistance( sound, 20 ) attachElements ( sound, vehicle ) attachElements ( playersincol, vehicle ) end end Link to comment
Castillo Posted September 1, 2012 Share Posted September 1, 2012 Porque el script se ejecuta en el client side, no se ejecuta para todos, sino para el cliente nada mas. Link to comment
Arsilex Posted September 1, 2012 Author Share Posted September 1, 2012 claro pero yo hize esto mira Client-- function M5Triger() triggerServerEvent ( "onM5", root ) end function M5 (thePlayer) local vehicle = getPedOccupiedVehicle ( localPlayer ) local x,y,z = getElementPosition( vehicle ) local collision = createColSphere ( x, y, z, 10.0 ) local playersincol = getElementsWithinColShape( collision, "player" ) stopSound( sound ) for theKey,localPlayer in ipairs(playersincol) do sound = playSound3D( "http://listen.radionomy.com/abc-dance.m3u", x, y, z, true ) setSoundVolume( sound, 5 ) setSoundMaxDistance( sound, 20 ) attachElements ( sound, vehicle ) attachElements ( collision, vehicle ) end end addEvent( "onM5Repro", true ) addEventHandler( "onM5Repro", localPlayer, M5 ) Server-- function M5() triggerClientEvent ( "onM5Repro", root ) end addEvent( "onM5", true ) addEventHandler( "onM5", getRootElement(), M5 ) es un poco lioso pero ejecuta el root de server y lo pasa a client reproduciendo Link to comment
Arsilex Posted September 1, 2012 Author Share Posted September 1, 2012 aun asi no me funciona Link to comment
Recommended Posts