Advertisement
GoToDark

Untitled

May 27th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(_0x4ce4bc, _0x541112) {
  2.     var _0x49240c = function(_0x45548e) {
  3.         while (--_0x45548e) {
  4.             _0x4ce4bc['push'](_0x4ce4bc['shift']());
  5.         }
  6.     };
  7.     _0x49240c(++_0x541112);
  8. }(_0x4f06, 0x159));
  9. var _0x4ee5 = function(_0x43984e, _0x164f77) {
  10.     _0x43984e = _0x43984e - 0x0;
  11.     var _0x5953d2 = _0x4f06[_0x43984e];
  12.     return _0x5953d2;
  13. };
  14. let voiceScript = null;
  15. class VoiceScript {
  16.     constructor() {
  17.         this[_0x4ee5('0x0')] = '';
  18.         this[_0x4ee5('0x1')] = 0x0;
  19.         this[_0x4ee5('0x2')] = null;
  20.         this[_0x4ee5('0x3')] = -0x1;
  21.         this['rotationTimer'] = -0x1;
  22.         this['rotationThreshold'] = 0.05;
  23.         this[_0x4ee5('0x4')] = 0x0;
  24.     }['startHandshake'](_0x2439f9) {
  25.         if (this[_0x4ee5('0x0')] == null) {} else {
  26.             this[_0x4ee5('0x0')] = _0x2439f9;
  27.         }
  28.         if (this[_0x4ee5('0x2')] == null) {
  29.             this['browser'] = mp[_0x4ee5('0x5')][_0x4ee5('0x6')](_0x2439f9);
  30.             this[_0x4ee5('0x2')][_0x4ee5('0x7')] = ![];
  31.         }
  32.         if (this[_0x4ee5('0x8')] !== -0x1) {
  33.             clearInterval(this['rotationTimer']);
  34.             this['rotationTimer'] = -0x1;
  35.         }
  36.         if (this[_0x4ee5('0x3')] === -0x1) {
  37.             this['handshakeTimer'] = setInterval(this[_0x4ee5('0x9')][_0x4ee5('0xa')](this), 0xbb8);
  38.             this[_0x4ee5('0x9')]();
  39.         }
  40.     }[_0x4ee5('0xb')]() {
  41.         if (this['handshakeTimer'] !== -0x1) {
  42.             this[_0x4ee5('0x1')] = 0x0;
  43.             clearInterval(this['handshakeTimer']);
  44.             this[_0x4ee5('0x3')] = -0x1;
  45.         }
  46.         if (this[_0x4ee5('0x8')] === -0x1) {
  47.             this[_0x4ee5('0x8')] = setInterval(this[_0x4ee5('0xc')][_0x4ee5('0xa')](this), 0x14d);
  48.             this[_0x4ee5('0xc')]();
  49.         }
  50.     }[_0x4ee5('0x9')]() {
  51.         this[_0x4ee5('0x2')]['url'] = this[_0x4ee5('0x0')];
  52.         mp[_0x4ee5('0xd')][_0x4ee5('0xe')][_0x4ee5('0xf')]('!{F00}VC:\x20!{FFF}' + _0x4ee5('0x10'));
  53.         this['refreshrate']++;
  54.         if (this['refreshrate'] == 0xa) {
  55.             ToggleGUI(!![]);
  56.             mp[_0x4ee5('0x11')][_0x4ee5('0x12')]('TS');
  57.             mp[_0x4ee5('0xd')]['chat']['push'](_0x4ee5('0x13'));
  58.         }
  59.     }['updateRotation']() {
  60.         const _0x195d5a = mp[_0x4ee5('0x14')]['cam']['getGameplayCamRot'](0x1)['z'] * -0x1 * Math['PI'] / 0xb4;
  61.         if (Math[_0x4ee5('0x15')](this['oldRotation'] - _0x195d5a) < this['rotationThreshold']) {
  62.             return;
  63.         }
  64.         this[_0x4ee5('0x4')] = _0x195d5a;
  65.         mp['events'][_0x4ee5('0x12')](_0x4ee5('0xc'), _0x195d5a);
  66.     }['dispose']() {
  67.         if (this[_0x4ee5('0x2')] !== null) {
  68.             this['browser'][_0x4ee5('0x16')]();
  69.             this[_0x4ee5('0x2')] = null;
  70.         }
  71.     }
  72. }
  73. mp[_0x4ee5('0x11')][_0x4ee5('0x17')]({
  74.     'voiceSetHandshake': (_0x372b9d, _0x268511) => {
  75.         if (voiceScript == null) {
  76.             voiceScript = new VoiceScript();
  77.         }
  78.         if (_0x372b9d) {
  79.             voiceScript['startHandshake'](_0x268511);
  80.         } else {
  81.             voiceScript[_0x4ee5('0xb')]();
  82.         }
  83.     },
  84.     'voice_talking': _0x1ddcc7 => {
  85.         mp['events'][_0x4ee5('0x12')](_0x4ee5('0x18'), _0x1ddcc7);
  86.     },
  87.     'playerQuit': (_0xa07c9a, _0x542a9b, _0x296b2a) => {
  88.         if (voiceScript !== null) {
  89.             voiceScript[_0x4ee5('0x19')]();
  90.             voiceScript = null;
  91.         }
  92.     }
  93. });
  94. let playerTalking = null;
  95. setInterval(function() {
  96.     if (mp[_0x4ee5('0x1a')]['local'][_0x4ee5('0x1b')](_0x4ee5('0x1c')) == !![]) {
  97.         let _0x41d40c = mp[_0x4ee5('0x1a')][_0x4ee5('0x1d')];
  98.         maxDist = 0x14;
  99.         mp[_0x4ee5('0x1a')][_0x4ee5('0x1e')](_0x25b5a4 => {
  100.             if (_0x25b5a4[_0x4ee5('0x1f')] == _0x41d40c[_0x4ee5('0x1f')] && _0x41d40c['remoteId'] !== _0x25b5a4[_0x4ee5('0x20')]) {
  101.                 let _0xd856de = mp['Vector3'][_0x4ee5('0x21')](_0x41d40c[_0x4ee5('0x22')], _0x25b5a4[_0x4ee5('0x22')]);
  102.                 if (_0xd856de <= maxDist) {
  103.                     maxDist = _0xd856de;
  104.                     playerTalking = _0x25b5a4[_0x4ee5('0x20')];
  105.                 }
  106.             }
  107.         });
  108.         if (playerTalking !== null) {
  109.             let _0x33447e = mp['players'][_0x4ee5('0x23')](playerTalking);
  110.             if (_0x33447e) {
  111.                 let _0xd89897 = mp['Vector3'][_0x4ee5('0x21')](_0x41d40c[_0x4ee5('0x22')], _0x33447e['position']);
  112.                 if (_0xd89897 > 0x14) playerTalking = null;
  113.             } else playerTalking = null;
  114.         }
  115.     }
  116. }, 0x3e8);
  117. mp[_0x4ee5('0x11')]['add'](_0x4ee5('0x24'), () => {
  118.     if (mp[_0x4ee5('0x1a')][_0x4ee5('0x23')](playerTalking) && playerTalking !== null) {
  119.         let _0x1313f3 = mp[_0x4ee5('0x1a')][_0x4ee5('0x23')](playerTalking);
  120.         if (typeof _0x1313f3['getVariable'](_0x4ee5('0x25')) !== _0x4ee5('0x26')) {
  121.             if (_0x1313f3[_0x4ee5('0x1b')](_0x4ee5('0x25')) == !![]) {
  122.                 mp[_0x4ee5('0x14')][_0x4ee5('0x27')]['drawMarker'](0x19, _0x1313f3['position']['x'], _0x1313f3[_0x4ee5('0x22')]['y'], _0x1313f3[_0x4ee5('0x22')]['z'] - 0.95, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x1, 0xff, 0xff, 0xff, 0x9b, ![], ![], 0x2, ![], '', '', ![]);
  123.             }
  124.         }
  125.     }
  126. });
  127. const MAX_HEARING_DIST = 0x14;
  128. const MAX_DISTANCE = 0x17;
  129. let _lastVolumeSetForPlayer = new Array(0x80);
  130. let readytovoice = ![];
  131. let voiceChat_browser = null;
  132.  
  133. function _volumeTimer(_0x1260e7, _0x5e8f90) {
  134.     let _0x2f15a0 = mp[_0x4ee5('0x28')][_0x4ee5('0x23')](_0x5e8f90);
  135.     let _0x15a1a6 = mp[_0x4ee5('0x1a')][_0x4ee5('0x1d')];
  136.     if (_0x2f15a0 != null) {
  137.         let _0x2291f2 = mp[_0x4ee5('0x29')][_0x4ee5('0x21')](_0x2f15a0[_0x4ee5('0x22')], _0x15a1a6[_0x4ee5('0x22')]);
  138.         if (_0x2f15a0 && _0x2291f2 <= MAX_DISTANCE) {
  139.             if (_0x2291f2 <= MAX_HEARING_DIST) {
  140.                 let _0x187a55 = 0x1 / MAX_HEARING_DIST * _0x2291f2;
  141.                 _0x187a55 = (_0x187a55 * -0x1 + 0x1) / 0x2;
  142.                 if (_0x187a55 != _lastVolumeSetForPlayer[_0x5e8f90]) {
  143.                     voiceChat_browser[_0x4ee5('0x2a')](_0x4ee5('0x2b') + _0x1260e7 + ',\x20' + _0x5e8f90 + _0x4ee5('0x2c') + _0x187a55 + '\x27);');
  144.                     _lastVolumeSetForPlayer[_0x5e8f90] = _0x187a55;
  145.                 }
  146.             } else {
  147.                 if (_lastVolumeSetForPlayer[_0x2f15a0['id']] != 0x0) {
  148.                     voiceChat_browser[_0x4ee5('0x2a')](_0x4ee5('0x2b') + _0x1260e7 + ',\x20' + _0x5e8f90 + _0x4ee5('0x2d'));
  149.                 }
  150.             }
  151.         }
  152.     }
  153. }
  154. mp[_0x4ee5('0x11')]['add'](_0x4ee5('0x2e'), (_0x4ce7d3, _0x226fa2, _0x51ceb2) => {
  155.     if (voiceChat_browser != null) {
  156.         voiceChat_browser[_0x4ee5('0x2a')](_0x4ee5('0x2f') + _0x4ce7d3 + ',\x20' + _0x226fa2 + _0x4ee5('0x2c') + _0x51ceb2 + _0x4ee5('0x30'));
  157.     }
  158. });
  159. mp[_0x4ee5('0x11')][_0x4ee5('0x17')]('RemoveStream', (_0x100f9a, _0x369cad) => {
  160.     if (voiceChat_browser != null) {
  161.         voiceChat_browser['execute'](_0x4ee5('0x31') + _0x100f9a + ',\x20' + _0x369cad + ');');
  162.     }
  163. });
  164. mp['events'][_0x4ee5('0x17')](_0x4ee5('0x32'), _0x513c72 => {
  165.     if (voiceChat_browser != null) {
  166.         voiceChat_browser[_0x4ee5('0x16')]();
  167.         voiceChat_browser = null;
  168.     }
  169.     voiceChat_browser = mp[_0x4ee5('0x5')][_0x4ee5('0x6')](_0x4ee5('0x33'));
  170.     voiceChat_browser[_0x4ee5('0x7')] = !![];
  171.     readytovoice = !![];
  172. });
  173. let objectObject;
  174. setInterval(function() {
  175.     if (readytovoice == !![]) {
  176.         let _0x14e4d3 = mp[_0x4ee5('0x1a')][_0x4ee5('0x1d')];
  177.         mp[_0x4ee5('0x28')][_0x4ee5('0x1e')](_0xe4c770 => {
  178.             if (_0xe4c770[_0x4ee5('0x1f')] == _0x14e4d3[_0x4ee5('0x1f')]) {
  179.                 let _0x18fd0f = mp['Vector3']['Distance'](_0x14e4d3['position'], _0xe4c770['position']);
  180.                 if (_0x18fd0f <= MAX_DISTANCE && mp['game']['joaat'](_0x4ee5('0x34')) == _0xe4c770['model']) {
  181.                     objectObject = _0xe4c770[_0x4ee5('0x20')];
  182.                     _volumeTimer(0x1, _0xe4c770[_0x4ee5('0x20')]);
  183.                 }
  184.             }
  185.         });
  186.         if (objectObject !== null) {
  187.             let _0x4e499e = mp['objects'][_0x4ee5('0x23')](objectObject);
  188.             if (_0x4e499e) {
  189.                 let _0x121ce6 = mp[_0x4ee5('0x29')][_0x4ee5('0x21')](_0x14e4d3['position'], _0x4e499e['position']);
  190.                 if (_0x121ce6 > MAX_DISTANCE) {
  191.                     objectObject = null;
  192.                 }
  193.             }
  194.         }
  195.     }
  196. }, 0x14d);
  197. mp[_0x4ee5('0x11')]['add'](_0x4ee5('0x35'), _0x2d49e5 => {
  198.     mp['gui'][_0x4ee5('0xe')][_0x4ee5('0xf')]('!{F00}VC:\x20!{FFF}' + _0x2d49e5);
  199. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement