#1

how to change automatic song streamer in car
Reply
#2

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
Reply
#3

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
Reply
#4

help
Reply
#5

help
Reply
#6

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.
Reply
#7

thank for helping

i find this forum to make auto song

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

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.
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)