Scripting/Squirrel/Functions/CreateRadioStream: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function will add a online radio to vehicle's radio. == Syntax == <pre>CreateRadioStream( radioName, radioURL, CanSelect )</pre> == Arguments == * ''string'' '''radio...")
 
No edit summary
 
(4 intermediate revisions by 4 users not shown)
Line 3: Line 3:
== Syntax ==
== Syntax ==


1
<pre>CreateRadioStream( radioName, radioURL, CanSelect )</pre>
<pre>CreateRadioStream( radioName, radioURL, CanSelect )</pre>
2
<pre>CreateRadioStream( streamID, radioName, radioURL, CanSelect )</pre>


== Arguments ==
== Arguments ==


* ''string'' '''radioName''' - The radio name
1
* ''string'' '''radioURL''' - The online radio URL
* ''string'' '''radioName''' - The radio name.
* ''string'' '''radioURL''' - The online radio URL.
* ''bool'' '''CanSelect''' - Show the radio stream on vehicle's radio list.
2
* ''int'' '''streamID''' - The radio id.
* ''string'' '''radioName''' - The radio name.
* ''string'' '''radioURL''' - The online radio URL.
* ''bool'' '''CanSelect''' - Show the radio stream on vehicle's radio list.
* ''bool'' '''CanSelect''' - Show the radio stream on vehicle's radio list.


== Example ==
== Example ==
The following example send a message to all saying '''Hello, have fun here!''':
The following is an example for radio stream. Link not provided.
<source lang=squirrel>
<source lang=squirrel>
function onPlayerCommand( player, cmd, text );
function onPlayerCommand( player, cmd, text );
{
{
if ( cmd == "radio" )
if ( cmd == "radio" )
{
{
  player.Vehicle.Radio = CreateRadioStream( "TestRadio", "YourURL", true );
player.Vehicle.Radio = CreateRadioStream( 15, "Vuelta", "http://redradioypc.com:8048/stream", true );
}
}
}
}
</source>
</source>
Line 29: Line 38:


{{Scripting/Squirrel/Functions/Game Functions}}
{{Scripting/Squirrel/Functions/Game Functions}}
[[Category:Scripting/Squirrel/Functions/Game_Functions]]

Latest revision as of 18:04, 30 January 2017

This function will add a online radio to vehicle's radio.

Syntax

1

CreateRadioStream( radioName, radioURL, CanSelect )

2

CreateRadioStream( streamID, radioName, radioURL, CanSelect )

Arguments

1

  • string radioName - The radio name.
  • string radioURL - The online radio URL.
  • bool CanSelect - Show the radio stream on vehicle's radio list.

2

  • int streamID - The radio id.
  • string radioName - The radio name.
  • string radioURL - The online radio URL.
  • bool CanSelect - Show the radio stream on vehicle's radio list.

Example

The following is an example for radio stream. Link not provided.

function onPlayerCommand( player, cmd, text );
{
	if ( cmd == "radio" )
	{
		player.Vehicle.Radio = CreateRadioStream( 15, "Vuelta", "http://redradioypc.com:8048/stream", true );
	}
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions