Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Variable Zoom Scope
#1
Hello

I am making OMA Zombies 2 and I decided to add this feature to it, I previewed this some time ago, here is the release, Nyan Cat

Code:
VariableZoom()
{
    self endon("death");
    self endon("disconnect");
    if(isdefined(self.zoomtext))
        self.zoomtext destroy();
    self.zoom = 60;
    originalzoom = getDvarInt("cg_fovmin");
    while(1)
    {
        if(self ADSButtonPressed() && WeaponClass(self getCurrentWeapon()) == "sniper")
        {
            if(!isdefined(self.zoomtext))
            {
                self.zoomtext = self createfontstring("default",1.3,self);
                self.zoomtext setpoint("","",0,-195);
                self.zoomtext settext("Press [{+activate}] to increase zoom and Press [{+frag}] to reduce zoom");
                self.zoomtext.color = (1,1,1);
                self.zoomtext.sort = 15;
                self.zoomtext.alpha = 1;
                self.zoomtext.foreground = true;
                self.zoomtext.glowcolor = (0,1,0);
                self.zoomtext.glowalpha = 1;
                self.zoomtext setparent(level.uiParent);
                self.zoomtext.hideWhenInMenu = false;
                self.zoomtext.archived = false;
            }
            if(self UseButtonPressed())
                self.zoom --;
            if(self FragButtonPressed())
                self.zoom ++;
            if(self.zoom > 60)
                self.zoom = 60;
            self setClientDvar("cg_fovmin",self.zoom);
        }
        else
        {
            self.zoomtext destroy();
            self setClientDvar("cg_fovmin",originalzoom);    
        }            
    wait 0.05;
    }
}

It has 1 bug: when they damage you(at least the zombies from my mod) it doesnt work anymore, Confused, I dont know the reason of that.
Reply

#2
OMA
Reply

#3
OMA

maybe when you damaged, cg_fovmin changes?

C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#4
You do know
originalzoom = getDvarInt("cg_fovmin");
only get's the dvar of the host and not the player right? Well, it doesn't matter since you can't change that dvar anyway, still kinda pointless that you get it.

Still pretty nice work @Yamato <3
[Image: MaEIQ.png]
Reply

#5
removed spam, pls keep threads clean
Reply

#6
(12-25-2011, 14:18)Pozzuh Wrote: You do know
originalzoom = getDvarInt("cg_fovmin");
only get's the dvar of the host and not the player right? Well, it doesn't matter since you can't change that dvar anyway, still kinda pointless that you get it.

Still pretty nice work @Yamato <3

Yes, I know, I just wanted to get the default value which is 1 I think, Wink
Reply

#7
usual you have a very short vid
where is it?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Music unlimited breath scope+sound when walking aim LE3* 0 1,996 04-21-2013, 08:42
Last Post: LE3*
  Help zoom on a sniper rifle CheGuevara 2 2,511 04-06-2013, 12:36
Last Post: CheGuevara
  Preview Sniper Zoom and Mad vending machines Yamato 18 10,119 03-13-2013, 21:50
Last Post: Nukem
  [Release] Auto Quick-Scope V1 for Black Ops d0h! 25 39,537 01-02-2013, 11:55
Last Post: joey
  Anti-Hard Scope laazyboy13 7 6,184 05-25-2012, 01:48
Last Post: laazyboy13
  Help uninitialised variable accomplishment tsoPANos 5 3,007 03-27-2012, 20:21
Last Post: Rendflex
  Help FIXED| static variable help | mfc c++ rotceh_dnih 1 1,848 11-19-2011, 05:18
Last Post: rotceh_dnih
  Wanted Scope Overlay Help COD BO Zeropoint 5 3,756 09-12-2011, 15:32
Last Post: iAegle
  Super XxX Hax Mega Ub3r TrickShotZ No Scope Hiper Snipez XxX Wallbang Snipah Mod Yamato 11 7,484 08-17-2011, 17:09
Last Post: Rendflex
  restore default zoom ? iAegle 16 8,638 08-16-2011, 21:45
Last Post: Pozzuh

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.