Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. local Keys = {
  2.  
  3. ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  4.  
  5. ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  6.  
  7. ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  8.  
  9. ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  10.  
  11. ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  12.  
  13. ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  14.  
  15. ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  16.  
  17. ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  18.  
  19. ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
  20.  
  21. }
  22.  
  23.  
  24.  
  25. local voice = {default = 5.0, shout = 12.0, whisper = 1.0, global = 19.0)
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. AddEventHandler('onClientMapStart', function()
  36.  
  37. if voice.current == 0 then
  38.  
  39. NetworkSetTalkerProximity(voice.default)
  40.  
  41. elseif voice.current == 1 then
  42.  
  43. NetworkSetTalkerProximity(voice.shout)
  44.  
  45. elseif voice.current == 2 then
  46.  
  47. NetworkSetTalkerProximity(voice.whisper)
  48.  
  49. end
  50.  
  51. end)
  52.  
  53.  
  54.  
  55. Citizen.CreateThread(function()
  56.  
  57. while true do
  58.  
  59. Citizen.Wait(1)
  60.  
  61.  
  62.  
  63. if IsControlJustPressed(1, Keys['H']) and IsControlPressed(1, Keys['LEFTSHIFT']) then
  64.  
  65. voice.current = (voice.current + 1) % 3
  66.  
  67. if voice.current == 0 then
  68.  
  69. NetworkSetTalkerProximity(voice.default)
  70.  
  71. voice.level = _U('normal')
  72.  
  73. elseif voice.current == 1 then
  74.  
  75. NetworkSetTalkerProximity(voice.shout)
  76.  
  77. voice.level = _U('shout')
  78.  
  79. elseif voice.current == 2 then
  80.  
  81. NetworkSetTalkerProximity(voice.whisper)
  82.  
  83. voice.level = _U('whisper')
  84.  
  85. end
  86.  
  87. end
  88.  
  89.  
  90.  
  91. if voice.current == 0 then
  92.  
  93. voice.level = _U('normal')
  94.  
  95. elseif voice.current == 1 then
  96.  
  97. voice.level = _U('shout')
  98.  
  99. elseif voice.current == 2 then
  100.  
  101. voice.level = _U('whisper')
  102.  
  103. end
  104.  
  105.  
  106.  
  107. if NetworkIsPlayerTalking(PlayerId()) then
  108.  
  109. drawLevel(41, 128, 185, 255)
  110.  
  111. elseif not NetworkIsPlayerTalking(PlayerId()) then
  112.  
  113. drawLevel(185, 185, 185, 255)
  114.  
  115. end
  116.  
  117. end
  118.  
  119. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement