function viewmodel() {
local = Entity.GetLocalPlayer();
scoped = Entity.GetProp(local, "CCSPlayer", "m_bIsScoped");
if (!Entity.IsAlive(local) || !World.GetServerString()) {
Convar.SetFloat("r_drawvgui", 1);
Convar.SetInt("fov_cs_debug", 0);
}
if (scoped) {
Convar.SetFloat("r_drawvgui", 0);
if (!UI.IsHotkeyActive("Visual", "WORLD", "View", "Thirdperson")) {
Cheat.ExecuteCommand("fov_cs_debug 90");
}
} else {
Convar.SetFloat("r_drawvgui", 1);
Convar.SetInt("fov_cs_debug", 0);
}
}
function unload() {
Cheat.ExecuteCommand("fov_cs_debug 0");
}
UI.AddCheckbox( "viewmodel" );
if (UI.GetValue("Script Items", "viewmodel" ) == true)
Cheat.RegisterCallback("CreateMove", "viewmodel");
Cheat.RegisterCallback("Unload", "unload");