Jump to content

Mimimiguel

Members
  • Posts

    146
  • Joined

  • Last visited

Everything posted by Mimimiguel

  1. try addEventHandler( "OnElementClicked", pedvar, yourfunction )
  2. Hello all, at first thanks for read it, another of my noobish questions, this: function actualizarPosicionSonido( sound, vehicle ) if sound and vehicle then x, y, z = getElementPosition( vehicle ) setElementPosition( sound, x, y, z ) end end function getSoundPath( id ) if id == 1 then return "http://salvajefm.com/modules/mod_ngs_shoutcast/singleplaylist.php?ip=94.75.209.28&port=8188&format=ASX" elseif id == 2 then return "http://194.169.201.177:8085/live3.mp3" elseif id == 3 then return "http://194.169.201.177:8085/liveDial.mp3" elseif id == 4 then return "http://194.169.201.177:8085/liveser.mp3" elseif id == 5 then return "http://rtve.stream.flumotion.com/rtve/radio1.mp3.m3u" elseif id == 7 then return "http://streaming.tst.es/stcasx/va90winlive2001/play.asx" end end sound = { [1] = {}, [2] = {}, [3] = {}, [4] = {}, [5] = {}, [6] = {}} addEvent( "playsound", true ) addEventHandler( "playsound", getRootElement(), function( veh, id, player ) if getElementData( player, "radio" ) == false then x, y, z = getElementPosition( veh ) path = getSoundPath( id ) sound[ player ] = playSound3D( path, x, y, z, false ) sound[1] = path sound[2] = x sound[3] = y sound[4] = z sound[5] = guiScrollBarGetScrollPosition (volumebar) / 50 sound[6] = setTimer( actualizarPosicionSonido, 50, 0, sound[player], getPedOccupiedVehicle( player ) ) setSoundMaxDistance( sound[player], maxdistance ) setElementData( player, "radio", true ) setSoundVolume( sound[player], sound[5] or 1 ) else stopSound( sound[ player ] ) sound[ player ] = nil sound[1] = nil sound[2] = nil sound[3] = nil sound[4] = nil sound[5] = nil killTimer( sound[6] ) sound[6] = nil setElementData( player, "radio", false ) end end ) returns: 'attempt to index global 'sound' ( a userdata value )' I did never had a error of this kind before so I don't know whats going on here
  3. It isnt returning any error I'm trying to fix them but it is harder if I don't know where it is the error, as debugscript doesn't return anything.
  4. I did never have more bugs in my scripts than now, I dont know why but in 1.0.5 those scripts were working fine. The new features are nice, but if should be more stable imo.
  5. Did it and worked fine, thanks!
  6. So instead of playSound3D( sound, x, y, z, false ) it should be for example playSound3D( "sound.mp3", x, y, z, false) ?
  7. Well, the sync worked fine but I had another bug that i still couldnt solve: sound = {} addEvent( "playsound", true ) addEventHandler( "playsound", getRootElement(), function( veh, sound, player ) if getElementData( player, "radio" ) == false then x, y, z = getElementPosition( veh ) sound[ player ] = playSound3D( sound, x, y, z, false ) setTimer( actualizarPosicionSonido, 50, 0, sound, veh ) setSoundMaxDistance( sound, maxdistance ) setElementData( player, "radio", true ) else stopSound( sound[ player ] ) sound[ player ] = nil setElementData( player, "radio", false ) end end ) Returns: Attempt to index local 'sound' ( a string value )
  8. Lets try it, ill post the results, thanks for the help.
  9. Yes, but the event starts from a gui so what should i do? trigger the event from the gui to the server and then trigger it again to the client?
  10. Yes, please, i think i take the idea but im not sure of how can i create a sound for everyone in clientside starting of a gui event. The idea its to use the playSound3D function, so when another player gets nearly the sound he can hear it.
  11. Is there any way to do this? In my radio system only the one who's playing it can hear the sound, so, is there any way to make everyone hear it? Thanks
  12. Cambia eso y debe funcionar.
  13. Ponlo client-side, postea el meta.xml
  14. Thanks!
  15. Where is it located? I couldn't find it, if someone knows where it is, post it please The garage name is: 'SFPD Police Impound Garage'
  16. The gamemode creates it automatically, it only need a database empty.
  17. Client-side: function switchRadio( player ) if getElementData( player, "radiomtasa" ) == false then radio = playSound( "http://84.120.31.176:34977/VîrtualDJ.ogg", true ) setElementData( player, "radiomtasa", true ) else stopSound( radio ) setElementData( player, "radiomtasa", false ) end end addCommandHandler( "radio", switchRadio ) Si no funciona usa /debugscript 2 y pon los errores que te de.
  18. Depende de para lo que lo quieras usar es más fácil de una manera u otra, para los markers es más simple la primera pero más coñazo, puedes hacer una tabla con las posiciones x, y, z; y aún más datos si quieres y luego hacer un 'for' con lo que creas los markers de una tirada. Queda bien hacer lo de los markers con una tabla de SQL y obtener de ahí los datos.
  19. Abre todos los programas que puedas
  20. Si dice cerca sera por que no lo sabe no crees?
  21. No entiendo nada jaja
  22. check out community.multitheftauto.com
  23. basicamente nos estas diciendo que te los hagamos, si fuese ayudar por lo menos lo intentarías
  24. no sería mas facil el comando en el clientside directamente y quitar unas líneas? si tienes miedo de que te lo roben usa un compilador y ya está
  25. y por que no:
×
×
  • Create New...