Advertisement
Guest User

Untitled

a guest
Jun 24th, 2016
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1.  
  2.  
  3. #include <a_samp>
  4. new PlayingMusic[MAX_PLAYERS];
  5. forward stopxf(playerid);
  6. #if defined FILTERSCRIPT
  7.  
  8.  
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n--------------------------------------");
  13. print(" AREA51 XFiles theme by Br0nXz_ loaded");
  14. print("--------------------------------------\n");
  15. return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20. return 1;
  21. }
  22.  
  23. #else
  24.  
  25. main()
  26. {
  27. print("\n----------------------------------");
  28. print(" AREA51 XFiles theme by Br0nXz_ unnloaded");
  29. print("----------------------------------\n");
  30. }
  31.  
  32. #endif
  33.  
  34.  
  35. public OnPlayerConnect(playerid)
  36. {
  37. PlayingMusic[playerid] = 0;
  38. return 1;
  39. }
  40.  
  41.  
  42. public stopxf(playerid)
  43. {
  44. PlayingMusic[playerid] = 0;
  45. StopAudioStreamForPlayer(playerid);
  46. return 1;
  47. }
  48.  
  49. public OnPlayerUpdate(playerid)
  50. {
  51. SetTimerEx("CheckArea", 2000, true, "i", playerid);
  52. return 1;
  53. }
  54.  
  55.  
  56.  
  57. forward CheckArea(playerid);
  58. public CheckArea(playerid)
  59. {
  60. if(IsPlayerInArea(playerid, -544.2247, 842.9382, 1106.2523, 2796.2766) && PlayingMusic[playerid] == 0)
  61. {
  62. SetTimerEx("stopxf", 180000, false, "i", playerid);
  63. PlayingMusic[playerid] = 1;
  64. PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/wos3db6jxt/The_XFiles_Theme.mp3",-261.05, 2227.15, 58.45, 2000.0, 1);
  65. }
  66.  
  67. else if(IsPlayerInArea(playerid, -544.2247, 842.9382, 1106.2523, 2796.2766) && PlayingMusic[playerid] == 1)
  68. {
  69. return 0;
  70. }
  71. else if(!IsPlayerInArea(playerid,-544.2247, 842.9382, 1106.2523, 2796.2766))
  72. {
  73. PlayingMusic[playerid] = 0;
  74. }
  75. return 1;
  76. }
  77.  
  78.  
  79. stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
  80. {
  81. new Float:x, Float:y, Float:z;
  82. GetPlayerPos(playerid, x, y, z);
  83. if(minx < x < maxx && miny < y < maxy) return true;
  84. return false;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement