Aerotactics

Untitled

Sep 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. //Red Balloons
  2. new TIMER_REDBALLOONS;
  3. new TIMER_REDBALLOONSEND;
  4. new RedBalloon[99];
  5. new bool:WaitBalloons = false;
  6.  
  7. CMD:redballoons(playerid, params[])
  8. {
  9. if(pInfo[playerid][pAdmin] < 6) return SCM(pid,COLOR_GREY,ERROR);
  10. if(WaitBalloons == true) return SCM(playerid, -1, "WAIT NIGGA");
  11. new version;
  12. if(sscanf(params, "i", version)) return SCM(playerid, -1, "USAGE: /redballoons [version] (1 = English, 2 = Rock)");
  13. if(version == 1)
  14. {
  15. for(new i=0; i<MAX_PLAYERS; i++)
  16. {
  17. if(!IsPlayerConnected(i)) continue;
  18. PlayAudioStreamForPlayer( i, "http://puu.sh/lzJYC/8ceff343e7.mp3" );
  19. SCM(i, COLOR_WHITE, "Use /stopstream to end the music stream.");
  20. }
  21. }
  22. else if(version == 2)
  23. {
  24. for(new i=0; i<MAX_PLAYERS; i++)
  25. {
  26. if(!IsPlayerConnected(i)) continue;
  27. PlayAudioStreamForPlayer( i, "http://puu.sh/lzKfC/ea33ff3354.mp3" );
  28. SCM(i, COLOR_WHITE, "Use /stopstream to end the music stream.");
  29. }
  30. }
  31. else return SCM(playerid, -1, "Version doesnt exist");
  32. WaitBalloons = true;
  33. TIMER_REDBALLOONS = SetTimerEx("RedBalloons", 500, true, "i", playerid);
  34. return 1;
  35. }
  36.  
  37. forward RedBalloons(playerid);
  38. public RedBalloons(playerid)
  39. {
  40. new Float:x, Float:y, Float:z;
  41. GetPlayerPos(playerid, x, y, z);
  42. new randX = random(45);
  43. new randY = random(45);
  44. new randZ = random(20);
  45. new randA = random(360);
  46. new randSignX = random(100);
  47. new randSignY = random(100);
  48. new randSignZ = random(100);
  49. new Float:fx, Float:fy, Float:fz;
  50. if(randSignX > 49)
  51. {
  52. fx = x + randX;
  53. }
  54. else fx = x - randX;
  55. if(randSignY > 49)
  56. {
  57. fy = y + randY;
  58. }
  59. else fy = y - randY;
  60. if(randSignZ > 49)
  61. {
  62. fz = z + randZ;
  63. }
  64. else fz = z - randZ;
  65. for(new i=0; i<99; i++)
  66. {
  67. if(!IsValidDynamicObject(RedBalloon[i]))
  68. {
  69. RedBalloon[i] = CreateDynamicObject(19091, fx, fy, fz, 0.00000, -90.00000, randA);
  70. MoveDynamicObject(RedBalloon[i], fx, fy, fz + 600, 0.6, 0, -90, randA);
  71. return 1;
  72. }
  73. if(i == 98)
  74. {
  75. TIMER_REDBALLOONSEND = SetTimer("RedBalloonsEnd", 200000, false);
  76. KillTimer(TIMER_REDBALLOONS);
  77. }
  78. }
  79. return 1;
  80. }
  81.  
  82. forward RedBalloonsEnd();
  83. public RedBalloonsEnd()
  84. {
  85. for(new i=0; i<99; i++)
  86. {
  87. DestroyDynamicObject(RedBalloon[i]);
  88. }
  89. WaitBalloons = false;
  90. KillTimer(TIMER_REDBALLOONSEND);
  91. return 1;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment