Jump to content

Por que :S


Arsilex

Recommended Posts

Posted

Por que no me funciona esto :S

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 

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted

Porque el script se ejecuta en el client side, no se ejecuta para todos, sino para el cliente nada mas.

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

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

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
  • Recently Browsing   0 members

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