// Chain Fire Zoom v2 // RoadKill // This script was written for trew to zoom 2x when you're chain is fireing // Is uses FOV zoom, and therefore will interact with the tribes "sniper" zoom // Version 0: Wraps action IDACTION_FIRE1/IDACTION_BREAK1 // Version 1: This Version wraps the stripped advanced fire code // Version 2: adds a toggle // To get the toggle to work in all edge cases it really should // be integrated into a fire pack to track fireing. I'll just // dupe it for now function AF::On() { %wep = GetMountedItem(0); if(%wep == -1) { $AF::NoWeapon = "TRUE"; Event::Trigger(EventNoWeapon); NextWeapon(); } else if(%wep != -1 && $AF::NoWeapon == "TRUE") { $AF::NoWeapon = ""; Event::Trigger(EventNewWeapon, %wep); } postAction(2048, IDACTION_FIRE1, 1); $AF::Firing = "TRUE"; Event::Trigger(EventYouFired, %wep); } function AF::Off() { %wep = GetMountedItem(0); postAction(2048, IDACTION_BREAK1, 1); $AF::Firing = ""; Event::Trigger(EventYouReleased, %wep); } EditActionMap("playMap.sae"); bindCommand(mouse0, make, button0, TO, "RK::chainZoomStart();"); bindCommand(mouse0, break, button0, TO, "RK::chainZoomStop();"); bindCommand(keyboard0, make, "/", TO, "RK::ToggleChainZoom();"); bindCommand(keyboard0, break, "/", TO, ""); $RK::chnZoomBase = $pref::PlayerFov; $RK::chnZoomTo = $RK::chnZoomBase / 2; $RK::chnZoomed = 0; $RK::fireing = 0; function RK::ToggleChainZoom() { if($RK::chnZoomed == -1) { $RK::chnZoomed = 0; Client::centerPrint(" CG Zoom ON", 1); schedule("Client::centerPrint(\"\", 1);", 1); if ($RK::fireing == 1) { $RK::chnZoomed = 1; $pref::PlayerFov = $RK::chnZoomTo; } } else { if ($RK::chnZoomed==1) { $pref::PlayerFOV = $RK::chnZoomBase; } $RK::chnZoomed = -1; Client::centerPrint(" CG Zoom OFF", 1); schedule("Client::centerPrint(\"\", 1);", 1); } } function RK::chainZoomStart() { $RK::fireing = 1; if ( getMountedItem(0) == 13) { if ($RK::chnZoomed == 0) { $RK::chnZoomed = 1; $pref::PlayerFov = $RK::chnZoomTo; } } //postAction(2048, IDACTION_FIRE1, -0); AF::On(); } function RK::chainZoomStop() { $RK::fireing = 0; if ($RK::chnZoomed == 1) { $RK::chnZoomed = 0; $pref::PlayerFOV = $RK::chnZoomBase; } //postAction(2048, IDACTION_BREAK1, -0); AF::Off(); }