Advertisement
Nyft_

Sistema Base, Caixa de Som ~Nyft

May 3rd, 2021 (edited)
766
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.19 KB | None | 0 0
  1. /*
  2.  
  3.     Tentar com ProxDetector
  4.  
  5. */
  6.  
  7. #include a_samp
  8. #include streamer
  9. #include pawn.cmd
  10.  
  11. new SoundBoxArea;
  12.  
  13. main(){}
  14.  
  15. public OnPlayerEnterDynamicArea(playerid, areaid)
  16. {
  17.     if(areaid == SoundBoxArea)
  18.     {
  19.         if(!IsValidDynamicArea(SoundBoxArea))
  20.             return 0;
  21.  
  22.         PlayAudioStreamForPlayer(playerid, "http://live.hunterfm.com/live");
  23.         SendClientMessage(playerid, -1, "* Você entrou em uma área onde tem uma caixa com o som ligado.");
  24.     }
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerLeaveDynamicArea(playerid, areaid)
  29. {
  30.     if(areaid == SoundBoxArea)
  31.     {
  32.         if(!IsValidDynamicArea(SoundBoxArea))
  33.             return 0;
  34.  
  35.         StopAudioStreamForPlayer(playerid);
  36.         SendClientMessage(playerid, -1, "* Você saiu de uma área onde tinha uma caixa com o som ligado.");
  37.     }
  38.     return 1;
  39. }
  40.  
  41. CMD:caixa(playerid)
  42. {
  43.     new objectid, Float:Pos[4];
  44.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  45.     GetPlayerFacingAngle(playerid, Pos[3]);
  46.    
  47.     objectid = CreateDynamicObject(2226, Pos[0], Pos[1], Pos[2], 0.0, 0.0, Pos[3]);
  48.     SoundBoxArea = CreateDynamicCircle(Pos[0], Pos[1], 10.0);
  49.     AttachDynamicAreaToObject(SoundBoxArea, objectid);
  50.     return 1;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement