Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MAX_SONGS 30
- #define MAX_SONG_URL 100
- new SongsUrl[MAX_SONGS][MAX_SONG_URL];
- new SongsNum;
- public OnFilterScriptInit()
- {
- new File:AudioFile;
- if(fexist("Songs.txt") == 0)
- {
- AudioFile = fopen("Songs.txt", io_write);
- fwrite(AudioFile,"http://iroquois.ru/Flo_Rida_-_Turn_Around.mp3\r\nhttp://irq.clan.su/connect.mp3");
- fclose(AudioFile);
- SongsUrl[0] = "http://iroquois.ru/Flo_Rida_-_Turn_Around.mp3";
- SongsUrl[1] = "http://irq.clan.su/connect.mp3";
- SongsNum = 2;
- }
- else AudioFile = fopen("Songs.txt", io_read);
- new string[MAX_SONG_URL];
- while(fread(AudioFile, string))
- {
- format(SongsUrl[SongsNum],MAX_SONG_URL,"%s",string);
- SongsNum++;
- }
- fclose(AudioFile);
- printf("\n- Треков загружено: %d\n- ConnectAudio 0.1 by KakbeYura\n- vk.com/sampfs_shop\n",SongsNum);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayAudioStreamForPlayer(playerid,SongsUrl[random(SongsNum)]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement