Advertisement
Guest User

ConnectAudio

a guest
Apr 29th, 2014
1,221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.07 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAX_SONGS 30
  4. #define MAX_SONG_URL 100
  5.  
  6. new SongsUrl[MAX_SONGS][MAX_SONG_URL];
  7. new SongsNum;
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     new File:AudioFile;
  12.     if(fexist("Songs.txt") == 0)
  13.     {
  14.         AudioFile = fopen("Songs.txt", io_write);
  15.         fwrite(AudioFile,"http://iroquois.ru/Flo_Rida_-_Turn_Around.mp3\r\nhttp://irq.clan.su/connect.mp3");
  16.         fclose(AudioFile);
  17.         SongsUrl[0] = "http://iroquois.ru/Flo_Rida_-_Turn_Around.mp3";
  18.         SongsUrl[1] = "http://irq.clan.su/connect.mp3";
  19.         SongsNum = 2;
  20.     }
  21.     else AudioFile = fopen("Songs.txt", io_read);
  22.     new string[MAX_SONG_URL];
  23.     while(fread(AudioFile, string))
  24.     {
  25.         format(SongsUrl[SongsNum],MAX_SONG_URL,"%s",string);
  26.         SongsNum++;
  27.     }
  28.     fclose(AudioFile);
  29.     printf("\n- Треков загружено: %d\n- ConnectAudio 0.1 by KakbeYura\n- vk.com/sampfs_shop\n",SongsNum);
  30.     return 1;
  31. }
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35.     PlayAudioStreamForPlayer(playerid,SongsUrl[random(SongsNum)]);
  36.     return 1;
  37. }
  38.  
  39. public OnPlayerSpawn(playerid)
  40. {
  41.     StopAudioStreamForPlayer(playerid);
  42.     return 1;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement