msprod Posted July 23, 2011 Share Posted July 23, 2011 hello, i'm french, i want to play streaming in a cars (radio channel) but there is no source and topic found. I can crerate any shoutcast radio for this but i haven't script. i have MTASA 1.1 server on linux. someone would exemple? very thanks Link to comment
bandi94 Posted July 23, 2011 Share Posted July 23, 2011 streaming in a cars (radio channel) ? if you mean live radio stream form internet its not possible if you mean to play .mp3 filse use : playSound("filename.mp3") whit addEventHandler("onPlayerVehicleEnter",......) Link to comment
SDK Posted July 23, 2011 Share Posted July 23, 2011 IIRC you should use playSound ( "url" ). The new sound functions from 1.1 aren't documented properly yet, but there are some events already on the wiki: https://wiki.multitheftauto.com/wiki/OnClientSoundStream. Link to comment
msprod Posted July 23, 2011 Author Share Posted July 23, 2011 playSound("http://myradio.com/listen.pls") it work in main game. I'm a newbie in MTA Script. have you a complete script for this: addEventHandler("onPlayerVehicleEnter", ?? ) ?? id=vehicle ? playSound("http://myradio.com/listen.pls") very thanks for you reply. Link to comment
bandi94 Posted July 23, 2011 Share Posted July 23, 2011 function radio playSound("http://myradio.com/listen.pls") end addEventHandler("onClientVehicleEnter",root,radio) client side the playSound("http://myradio.com/listen.pls") its only a beta/test for new version of mta may not work ... i don't try if work or not (or bug's...) Link to comment
msprod Posted July 23, 2011 Author Share Posted July 23, 2011 can i play this with specific vehicle ? exemple: play radio police with police car function radio playSound("http://policer_radio.com/listen.pls") end addEventHandler("onClientVehicleEnter",root,radio) (car id ?) very thanks... i test this.... thanks thanks thanks Link to comment
msprod Posted July 23, 2011 Author Share Posted July 23, 2011 ERROR File'radio_client.lua' in rsource 'radio -CRC mismatch' ... idea ? Link to comment
bandi94 Posted July 23, 2011 Share Posted July 23, 2011 (edited) function radio local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) local id = getVehicleID(vehicle) if (id== write the car id ) then playSound("http://myradio.com/listen.pls") end end addEventHandler("onClientVehicleEnter",root,radio) if whit getVehicleID not work use getElementModel Edited July 23, 2011 by Guest Link to comment
msprod Posted July 23, 2011 Author Share Posted July 23, 2011 Ouaw !! thanks;.. i test this... Link to comment
msprod Posted July 23, 2011 Author Share Posted July 23, 2011 ERROR File'radio_client.lua' in rsource 'radio -CRC mismatch' to... Link to comment
bandi94 Posted July 23, 2011 Share Posted July 23, 2011 this is the version 1.1 whit live stearm i think ist or wrong the playSound("http://myradio.com/listen.pls") or is buged i don't tryed to use the new beta/test scripts of the new version Link to comment
qaisjp Posted July 23, 2011 Share Posted July 23, 2011 msprod, use /restart radio to prevent that error. Link to comment
msprod Posted July 23, 2011 Author Share Posted July 23, 2011 same probleme... same error... this my script: function radio local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) local id = getVehicleID(vehicle) if (id== 411 ) then playSound("http://myradio.com/listen.pls") end end addEventHandler("onClientVehicleEnter",root,radio) Link to comment
SDK Posted July 23, 2011 Share Posted July 23, 2011 Bandi, get out if you can't even put brackets behind your functions. function radio () local id = getElementModel(source) if (id== 411 ) then playSound("http://myradio.com/listen.pls") end end addEventHandler("onClientVehicleEnter", getLocalPlayer(), radio) And crc mismatch means something went wrong when downloading the file. Restart, check meta, remove strange characters from resource/script names. Link to comment
msprod Posted July 23, 2011 Author Share Posted July 23, 2011 (edited) very thanks for all !!! thi my scipt work : function startMySound() local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) local id = getVehicleID(vehicle) if (id== 411 ) then setRadioChannel(0) sound = playSound( "http://88.190.24.47/listen.pls", true ) end if (id== 429 ) then setRadioChannel(0) sound = playSound( "http://212.45.104.34:8042/listen.pls", true ) end end addEventHandler("onClientPlayerVehicleEnter",getRootElement(),startMySound) function stopMySound() stopSound( sound ) end addCommandHandler ( "stopsound", stopMySound ) addEventHandler("onClientPlayerVehicleExit",getRootElement(),stopMySound) I have a litle probleme, When the car is totally destroy and explose, this radio is active. addEventHandler("onClientPlayerVehicle[b]Destroy[/b]",getRootElement(),startMySound) how can stop radio when car is destroyed ? you can test this in my server: mtasa://89.3.230.154:22003 happy game ! Edited July 23, 2011 by Guest Link to comment
bandi94 Posted July 23, 2011 Share Posted July 23, 2011 SDK ..... if you think i have time to check 3 times a script the ..... i am not obsessed to stay in fornt of comp all day long(like you) i made that script in les that 30 sec i forget to put and say to your ... what to do ok ..... and addEventHandler("onClientVehicleEnter", getLocalPlayer(), radio) its work 100% whit root and its clients side not server so ... Link to comment
msprod Posted July 24, 2011 Author Share Posted July 24, 2011 May I'm sorry I did not understand ... ! (french) Link to comment
bandi94 Posted July 24, 2011 Share Posted July 24, 2011 i say that for SDK he think he is the "BOSS" and he say to me what to do ....... (SDK run and say to solidsnake what you say to me he write "functon") go fast if you think you are the BOss... Link to comment
will briggs Posted July 24, 2011 Share Posted July 24, 2011 i say that for SDK he think he is the "BOSS" and he say to me what to do ....... (SDK run and say to solidsnake what you say to me he write "functon") go fast if you think you are the BOss... Solid snake isn't the boss btw, as you were inferring... Link to comment
msprod Posted July 25, 2011 Author Share Posted July 25, 2011 I do not understand anything!! I just ask for help, I do not see what you mean ... my problem: when the car explodes the radio is active. how can I stop the car radio is quad exploded Thanks. Link to comment
msprod Posted July 25, 2011 Author Share Posted July 25, 2011 it work .... ! verry thanke for U Link to comment
qaisjp Posted July 26, 2011 Share Posted July 26, 2011 onClientElementDestroy [lua] if getPedOccupiedVehicle(me) == source then stopSound(sound) end [/lua Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now