Advertisement
DraKiNs

[Include] Audio Stream No-Message

Oct 13th, 2011
2,668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.88 KB | None | 0 0
  1. /*=================================================================
  2.          _ ____         _____             __  __
  3.         (_)  _ \ ___  |_   _|__  __ _|  \/  |
  4.         | | |_) / __|   | |/ _ \/ _` | |\/| |
  5.         | |  __/\__ \   | |  __/ (_| | |  | |
  6.         |_|_|   |___/   |_|\___|\__,_|_|  |_|
  7.  
  8.             Created by Bruno da Silva
  9.             www.ips-team.blogspot.com
  10.        No more messages on Audio Stream SA:MP
  11.  
  12. =================================================================*/
  13.  
  14. enum eMessageData
  15. {
  16.     msgColor,
  17.     msgText[128]
  18. }
  19. new
  20.     gMessageData[MAX_PLAYERS][21][eMessageData],
  21.     sendMessages[MAX_PLAYERS] = {-1, ...}  
  22. ;
  23.  
  24. SendClientMessageInternal(playerid, color, message[])
  25. {
  26.     if(sendMessages[playerid] == 20)
  27.     {
  28.         sendMessages[playerid]  = -1;  
  29.     }
  30.  
  31.     gMessageData[playerid][++sendMessages[playerid]][msgColor] = color;
  32.    
  33.     format(gMessageData[playerid][sendMessages[playerid]][msgText], 128, message);
  34.  
  35.     return SendClientMessage(playerid, color, message);
  36. }
  37.  
  38. stock PlayAudioInternal(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
  39. {  
  40.     PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
  41.  
  42.     for(new i; sendMessages[playerid] >= i; ++i)
  43.     {  
  44.         SendClientMessage(playerid, gMessageData[playerid][i][msgColor], gMessageData[playerid][i][msgText]);
  45.     }
  46.     return true;
  47. }
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51.     for(new i; 21 > i; ++i)
  52.     {
  53.         gMessageData[playerid][i][msgText][0] = EOS;
  54.         gMessageData[playerid][i][msgColor] = 0xFFFFFFFF;
  55.    
  56.     }
  57.  
  58.     sendMessages[playerid] = -1;
  59.  
  60.     return CallLocalFunction("CallOnPlayerConnect", "i", playerid);
  61. }
  62.  
  63.  
  64. #if defined HookOnPlayerConnect
  65. #undef OnPlayerConnect
  66. #else
  67. #define HookOnPlayerConnect
  68. #endif
  69.  
  70. #define SendClientMessage       SendClientMessageInternal
  71. #define PlayAudioStreamForPlayer    PlayAudioInternal
  72.  
  73. // ips_audiofix.inc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement