Jump to content

Streaming Radio in Cars ?


msprod

Recommended Posts

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 :wink:

Link to comment

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
  
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

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
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 by Guest
Link to comment

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

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

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 by Guest
Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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