SHARE
TWEET

Untitled

a guest Mar 9th, 2018 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <voice>                //20
  2.  
  3. // PRESSED(keys)
  4. #define PRESSED(%0) \
  5.     (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  6.  
  7. // RELEASED(keys)
  8. #define RELEASED(%0) \
  9.     (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
  10.  
  11. public OnPlayerVoice(playerid, BitStream:bs)
  12. {
  13.     // Adauga?i text deasupra capului jucatorului vorbitor
  14.     SetPlayerChatBubble(playerid, "Speaker", COLOR_WHITE, 10.00, 1000);
  15.  
  16.  
  17.     // Ob?ine?i pozi?ia jucatorului vorbitor
  18.     new Float:pos[3];
  19.     GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  20.  
  21.     for(new i = 0; i < MAX_PLAYERS; i++)
  22.     {
  23.         if(playerid == i) continue;
  24.         if(!IsPlayerConnected(i)) continue;
  25.  
  26.  
  27.     //Trimite?i un pachet de voce tuturor jucatorilor pe o raza de 10 metri
  28.         if(IsPlayerInRangeOfPoint(i, 10.00, pos[0], pos[1], pos[2])) {
  29.             SendVoice(i, bs); // Trimiterea unui pachet de voce
  30.         }
  31.     }
  32.  
  33.     return 1;
  34. }
  35.  
  36. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  37.     if(newkeys & KEY_YES) {
  38.         if(PRESSED(KEY_YES)) StartVoice(playerid);
  39.         if(RELEASED(KEY_YES)) StopVoice(playerid);
  40.         return 1;
  41.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top