ItsMods
[Release] Variable Zoom Scope - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Release] Variable Zoom Scope (/Thread-Release-Variable-Zoom-Scope.html)



Variable Zoom Scope - Yamato - 12-25-2011

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.


RE: Variable Zoom Scope - Rendflex - 12-25-2011

OMA


RE: Variable Zoom Scope - Nekochan - 12-25-2011

OMA

maybe when you damaged, cg_fovmin changes?




RE: Variable Zoom Scope - Pozzuh - 12-25-2011

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


RE: Variable Zoom Scope - d0h! - 12-25-2011

removed spam, pls keep threads clean


RE: Variable Zoom Scope - Yamato - 12-25-2011

(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


RE: Variable Zoom Scope - GscGunner - 12-30-2011

usual you have a very short vid
where is it?