Advertisement
miguelspastes

AWZ

Jan 15th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. -- Advanced Weapon Zoom -- made by burakd, updated by requinox
  2. local aimactive = 0;
  3. local use_allowed_weapon = 1;
  4. local visualsreference = gui.Reference("misc", "general" ,"main");
  5.  
  6.  
  7. local msc_showaw = gui.Checkbox( visualsreference, "msc_showaw", "AWZ", true );
  8. local AWPKey = gui.Keybox(visualsreference, "AWPKeybind", "AWZ Key", 0);
  9.  
  10.  
  11.  
  12. local function itemcheck(Event)
  13.  
  14. if (Event:GetName() ~= 'item_equip') then
  15. return;
  16. end
  17.  
  18.  
  19.  
  20.  
  21.  
  22. local local_player, userid, item, weptype = client.GetLocalPlayerIndex(), Event:GetInt('userid'), Event:GetString('item'), Event:GetInt('weptype');
  23.  
  24. if (local_player == client.GetPlayerIndexByUserID(userid)) then
  25. if (item == "ak47" or item == "aug" or item == "ssg08" or item == "awp" or item == "m4a1" or item == "tec9" or item == "galilar" or item == "galilar" or item == "bizon" or item == "ump45" or item == "mp9" ) then
  26. use_allowed_weapon = 1;
  27. else
  28. use_allowed_weapon = 0;
  29. aimactive = 0;
  30. end
  31. end
  32. end
  33.  
  34. local function main()
  35.  
  36. if (msc_showaw:GetValue() == false) then
  37. return;
  38. end
  39.  
  40. if AWPKey:GetValue() ~= 0 then
  41. if input.IsButtonPressed(AWPKey:GetValue()) then
  42. if ( aimactive == 0 ) then
  43. aimactive = aimactive + 1;
  44. else
  45. aimactive = 0;
  46.  
  47. end
  48. end
  49. end
  50.  
  51.  
  52.  
  53. if ( aimactive == 1 and use_allowed_weapon == 1 ) then
  54.  
  55.  
  56. if(client.GetConVar("viewmodel_offset_x") + 0 >= -5.1)
  57. then
  58. client.SetConVar("viewmodel_offset_x", client.GetConVar("viewmodel_offset_x") -0.3, true);
  59. end
  60.  
  61. if(client.GetConVar("viewmodel_offset_y") + 0 >= -6.8)
  62. then
  63. client.SetConVar("viewmodel_offset_y", client.GetConVar("viewmodel_offset_y") -0.3, true);
  64. end
  65.  
  66. if(client.GetConVar("viewmodel_offset_z") + 0 <= 0.8)
  67. then
  68. client.SetConVar("viewmodel_offset_z", client.GetConVar("viewmodel_offset_z") +0.3, true);
  69. end
  70.  
  71.  
  72. client.SetConVar("viewmodel_fov", 60, true);
  73.  
  74.  
  75.  
  76. else
  77.  
  78. if(client.GetConVar("viewmodel_offset_x") + 0 <= 1)
  79. then
  80. client.SetConVar("viewmodel_offset_x", client.GetConVar("viewmodel_offset_x") +0.1, true);
  81. end
  82.  
  83. if(client.GetConVar("viewmodel_offset_y") + 0 <= 1)
  84. then
  85. client.SetConVar("viewmodel_offset_y", client.GetConVar("viewmodel_offset_y") +0.1, true);
  86. end
  87.  
  88. if(client.GetConVar("viewmodel_offset_z") + 0 >= -1)
  89. then
  90. client.SetConVar("viewmodel_offset_z", client.GetConVar("viewmodel_offset_z") -0.1, true);
  91. end
  92.  
  93. client.SetConVar("viewmodel_fov", 80, true);
  94. end
  95.  
  96.  
  97. end
  98.  
  99.  
  100. callbacks.Register( "Draw", "misc", main);
  101. client.AllowListener('item_equip');
  102. callbacks.Register("FireGameEvent", "itemcheck", itemcheck);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement