wavelengthzero
Active member
- Joined
- Feb 18, 2014
- Messages
- 45
- Reaction score
- 0
With this mod you can search YouTube from SA:MP and begin an audio stream (all files convert to 128kbps .ogg). Example: "/fvrad martin garrix - animals" (without the quotes). This will find the closest matching song name, convert and stream very quickly.
Alternatively, if the wrong song is selected or not found, you can enter a direct YouTube link. See the usage for better understanding.
Usage:
Source:
Known bugs:
- Typing a song name will not always play the song you wanted, but will 99% of the time it will
- For songs longer than 10 minutes you will likely need to send the command again as the SA:MP timeout for redirect headers is too low
Hopefully you find use out of this mod, it's my first release. I'm new to cleo so thanks to Monday for some help.
Alternatively, if the wrong song is selected or not found, you can enter a direct YouTube link. See the usage for better understanding.
Usage:
Code:
(These will convert to .ogg and stream from YouTube links)
/rad <Link> (Types /radio)
/vrad <Link> (Types /vradio)
/vrm <Link> (Types /vrmusic)
/vwa <Link> (Types /vwaudio)
(These will search the words you typed on YouTube, get the nearest match, convert to .ogg and stream)
/frad <Song Name> (Types /radio)
/fvrad <Song Name> (Types /vradio)
/fvrm <Song Name> (Types /vrmusic)
/fvwa <Song Name> (Types /vwaudio)
Source:
Code:
{$CLEO .cs}
//-------------MAIN---------------
0000: NOP
0B34: samp register_client_command "rad" to_label @cmd1
0B34: samp register_client_command "vrad" to_label @cmd2
0B34: samp register_client_command "vrm" to_label @cmd3
0B34: samp register_client_command "vwa" to_label @cmd4
0B34: samp register_client_command "frad" to_label @cmd5
0B34: samp register_client_command "fvrad" to_label @cmd6
0B34: samp register_client_command "fvwa" to_label @cmd7
0B34: samp register_client_command "fvrm" to_label @cmd8
30@ = 0
:Label
wait 0
if or
30@ == 1
30@ == 2
30@ == 3
30@ == 4
30@ == 5
30@ == 6
30@ == 7
30@ == 8
else_jump @Label
SAMP.IsCommandTyped(1@)
if
0AD4: 2@ = scan_string 1@ format "%s" 3@v
then
if 30@ == 1
then
say "/radio https:%c%c6t.pe%c?%s" 47 47 47 1@
30@ = 0
end
if 30@ == 2
then
say "/vradio https:%c%c6t.pe%c?%s" 47 47 47 1@
30@ = 0
end
if 30@ == 3
then
say "/vrmusic https:%c%c6t.pe%c?%s" 47 47 47 1@
30@ = 0
end
if 30@ == 4
then
say "/vwaudio https:%c%c6t.pe%c?%s" 47 47 47 1@
30@ = 0
end
if 30@ == 5
then
say "/radio https:%c%c6t.pe%c?song=%s" 47 47 47 1@
30@ = 0
end
if 30@ == 6
then
say "/vradio https:%c%c6t.pe%c?song=%s" 47 47 47 1@
30@ = 0
end
if 30@ == 7
then
say "/vwaudio https:%c%c6t.pe%c?song=%s" 47 47 47 1@
30@ = 0
end
if 30@ == 8
then
say "/vrmusic https:%c%c6t.pe%c?song=%s" 47 47 47 1@
30@ = 0
end
else
chatmsg "USAGE: /rad <URL>, /vrad <URL>, /vrm <URL>, /vwa <URL>" 6356832
chatmsg "SEARCH YOUTUBE AND CONVERT: /frad (song name), /fvrad (song name), /fvrm (song name), /fvwa (song name)" 16736352
30@ = 0
end
jump @Label
:cmd1
30@ = 1
SAMP.CmdRet
:cmd2
30@ = 2
SAMP.CmdRet
:cmd3
30@ = 3
SAMP.CmdRet
:cmd4
30@ = 4
SAMP.CmdRet
:cmd5
30@ = 5
SAMP.CmdRet
:cmd6
30@ = 6
SAMP.CmdRet
:cmd7
30@ = 7
SAMP.CmdRet
:cmd8
30@ = 8
SAMP.CmdRet
Known bugs:
- Typing a song name will not always play the song you wanted, but will 99% of the time it will
- For songs longer than 10 minutes you will likely need to send the command again as the SA:MP timeout for redirect headers is too low
Hopefully you find use out of this mod, it's my first release. I'm new to cleo so thanks to Monday for some help.