Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Advanced Weapon Zoom -- made by burakd, updated by requinox
- local aimactive = 0;
- local use_allowed_weapon = 1;
- local visualsreference = gui.Reference("misc", "general" ,"main");
- local msc_showaw = gui.Checkbox( visualsreference, "msc_showaw", "AWZ", true );
- local AWPKey = gui.Keybox(visualsreference, "AWPKeybind", "AWZ Key", 0);
- local function itemcheck(Event)
- if (Event:GetName() ~= 'item_equip') then
- return;
- end
- local local_player, userid, item, weptype = client.GetLocalPlayerIndex(), Event:GetInt('userid'), Event:GetString('item'), Event:GetInt('weptype');
- if (local_player == client.GetPlayerIndexByUserID(userid)) then
- 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
- use_allowed_weapon = 1;
- else
- use_allowed_weapon = 0;
- aimactive = 0;
- end
- end
- end
- local function main()
- if (msc_showaw:GetValue() == false) then
- return;
- end
- if AWPKey:GetValue() ~= 0 then
- if input.IsButtonPressed(AWPKey:GetValue()) then
- if ( aimactive == 0 ) then
- aimactive = aimactive + 1;
- else
- aimactive = 0;
- end
- end
- end
- if ( aimactive == 1 and use_allowed_weapon == 1 ) then
- if(client.GetConVar("viewmodel_offset_x") + 0 >= -5.1)
- then
- client.SetConVar("viewmodel_offset_x", client.GetConVar("viewmodel_offset_x") -0.3, true);
- end
- if(client.GetConVar("viewmodel_offset_y") + 0 >= -6.8)
- then
- client.SetConVar("viewmodel_offset_y", client.GetConVar("viewmodel_offset_y") -0.3, true);
- end
- if(client.GetConVar("viewmodel_offset_z") + 0 <= 0.8)
- then
- client.SetConVar("viewmodel_offset_z", client.GetConVar("viewmodel_offset_z") +0.3, true);
- end
- client.SetConVar("viewmodel_fov", 60, true);
- else
- if(client.GetConVar("viewmodel_offset_x") + 0 <= 1)
- then
- client.SetConVar("viewmodel_offset_x", client.GetConVar("viewmodel_offset_x") +0.1, true);
- end
- if(client.GetConVar("viewmodel_offset_y") + 0 <= 1)
- then
- client.SetConVar("viewmodel_offset_y", client.GetConVar("viewmodel_offset_y") +0.1, true);
- end
- if(client.GetConVar("viewmodel_offset_z") + 0 >= -1)
- then
- client.SetConVar("viewmodel_offset_z", client.GetConVar("viewmodel_offset_z") -0.1, true);
- end
- client.SetConVar("viewmodel_fov", 80, true);
- end
- end
- callbacks.Register( "Draw", "misc", main);
- client.AllowListener('item_equip');
- callbacks.Register("FireGameEvent", "itemcheck", itemcheck);
Advertisement
Add Comment
Please, Sign In to add comment