SA-MP Forums Archive
song - 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: song (/showthread.php?tid=632130)



song - crukk11 - 09.04.2017

how to change automatic song streamer in car


Re: song - Meller - 09.04.2017

Well, this section is not a "how-to" question section. In order to get some kind of help the community recommends you to try first on your own and if you can't, upload your code and tell us what's not working. And some nice fellow community members will for sure help you out.

To get a headstart you can try searching for the following callbacks and functions:
OnPlayerStateChange
PlayerPlaySound


Re: song - crukk11 - 11.04.2017

my code

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
     
PlayAudioStreamForPlayer(playeridRandomSongs[random(sizeof(RandomSongs))]);         
    }
    else if(
oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
    {
        
StopAudioStreamForPlayer(playerid); 
    }
    return 
0;

when the song end how to auto the song back


Re: song - crukk11 - 12.04.2017

help


Re: song - crukk11 - 12.04.2017

help


Re: song - Sew_Sumi - 12.04.2017

Quote:
Originally Posted by crukk11
Посмотреть сообщение
when the song end how to auto the song back
https://sampforum.blast.hk/showthread.php?tid=320135

Can't be done wihout timers, and timing what songs are to play and making them go to the next on the end of each song.

Best to just use a streaming radio service.


Re: song - crukk11 - 12.04.2017

thank for helping

i find this forum to make auto song

https://sampforum.blast.hk/showthread.php?tid=385930


Re: song - Sew_Sumi - 12.04.2017

That's just a timer, set for 3 minutes solid... Not every song is 3 minutes...

Follow Y-Less' advice, as he mentions storing each songs length in an array, and using that to make a timer so each song is counted, rather than being the fixed 3 minute timer.


Re: song - YouHack - 12.04.2017

Simply... use a direct radio link and relax ( such as tunein and shoutcast, there are alot! )