BananasTheKing

Enhanced Voc Test #1

Jan 14th, 2018
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. --[[
  2. © 2012 CloudSixteen.com do not share, re-distribute or modify
  3. without permission of its author ([email protected]).
  4. --]]
  5.  
  6. local PLUGIN = PLUGIN;
  7.  
  8. -- Called when a player's typing display has started.
  9. function PLUGIN:PlayerStartTypingDisplay(player, code)
  10. if (player:GetFaction() == FACTION_MPF or player:GetModel() == "models/jim_combine/police.mdl" and !player:IsNoClipping()) then
  11. if (code == "n" or code == "y" or code == "w" or code == "r") then
  12. if (!player.typingBeep) then
  13. player.typingBeep = true;
  14.  
  15. player:EmitSound("ambient/levels/prison/radio_random"..math.random(1, 15)..".wav");
  16. end;
  17. end;
  18. end;
  19. elseif (player:GetFaction() == FACTION_OTA) then
  20. if (code == "n" or code == "y" or code == "w" or code == "r") then
  21. if (!player.typingBeep) then
  22. player.typingBeep = true;
  23.  
  24. player:EmitSound("common/on"..math.random(1, 6)..".mp3");
  25. end;
  26. end;
  27. end;
  28. end;
  29.  
  30. -- Called when a player's typing display has finished.
  31. function PLUGIN:PlayerFinishTypingDisplay(player, textTyped)
  32. if (player:GetFaction() == FACTION_MPF and textTyped) then
  33. if (player.typingBeep) then
  34. if(math.random(1, 2) == 1) then
  35. player:EmitSound("ambient/levels/prison/radio_random7.wav");
  36. else
  37. player:EmitSound("ambient/levels/prison/radio_random8.wav");
  38. end;
  39. end;
  40. elseif (player:GetFaction() == FACTION_OTA) then
  41. if (player.typingBeep) then
  42. player:EmitSound("common/off"..math.random(1, 9)..".mp3");
  43. end;
  44. end;
  45.  
  46. player.typingBeep = nil;
  47. end;
Advertisement
Add Comment
Please, Sign In to add comment