[QUESTION]Music - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [QUESTION]Music (
/showthread.php?tid=645735)
[QUESTION]Music -
Kraeror - 03.12.2017
Hello guys, can you tell me is it possible to play music with PlayAudioStreamForPlayer function but from *******, like pasting the link in the dialog (I have already made the command + dialog) I'm using ******* include, but the music sometimes stops, IDK why? So is it possible to convert the video automaticly using the site (
http://www.flvto.biz) and the server gets the converted link, like when I type:
https://www.youtube.com/watch?v=123456789 it plays the song, without downloading, just convert it automaticly?
If it is possible, pls tell me the method for doing that!
Note: I'm realy sorry about my bad english, I hope you understand me
Re: [QUESTION]Music -
FuNkYTheGreat - 03.12.2017
https://sampforum.blast.hk/showthread.php?tid=640346
Try my SA Tube, Copy the method i'm using, In that you don't need to download anything just enter the Link and enjoy !
Re: [QUESTION]Music -
Kraeror - 03.12.2017
I can't understand your method, can you give me an example for formating the link to converted?
Re: [QUESTION]Music -
FuNkYTheGreat - 03.12.2017
Код:
forward Request*******2Mp3( playerid, response_code, data[ ] );
public Request*******2Mp3( playerid, response_code, data[ ] )
{
if( response_code == 200 )
{
new
start_pos = strfind( data, "\"url\":" ) + 9,
end_pos = strfind( data, "\"", .pos = start_pos ),
mp3_coverted_link[ 500 ];
strmid( mp3_coverted_link, data,start_pos,end_pos );
format( mp3_coverted_link, sizeof( mp3_coverted_link ), "http://%s", mp3_coverted_link );
PlayAudioStreamForPlayer( playerid, mp3_coverted_link );
}
else
SendClientMessage( playerid, -1, "Couldn't play the song!!!" );
return 1;
}
Play*******Audio( playerid, video_link[ ] )
{
new
param_v_idx = strfind( video_link, "?v=" ) + 3,
video_id[ 15 ],
payload[ 55 ];
strmid( video_id, video_link, param_v_idx, strlen( video_link ) );
format( payload, sizeof( payload ), "www.yt-mp3.com/fetch?v=%s&apikey=1234567", video_id );
HTTP( playerid, HTTP_GET, payload, "", "Request*******2Mp3" );
return 1;
}
Simple as that.
Use it like:
Код:
Play*******Audio( playerid, *******.com/HOOHHOH)
Re: [QUESTION]Music -
Kraeror - 03.12.2017
Result:
Re: [QUESTION]Music -
Kraeror - 03.12.2017
Any help?
Re: [QUESTION]Music -
Kraeror - 03.12.2017
pls help me
Re: [QUESTION]Music -
Kraeror - 03.12.2017
Any other method guys?
Please, I realy need this