Raised This Month: $82 Target: $400
 20% 

DoD Variable-Zoom Scopes


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Day of Defeat        Category:   Gameplay        Approver:   Emp` (115)
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 12-25-2007 , 17:35   DoD Variable-Zoom Scopes
Reply With Quote #1

DOD Zoomscopes for Day of Defeat 1.3
(updated 6-30-09)

This plugin will turn DOD rifle scopes into scopes with a variable zoom.
(yes, I'm well aware that they didn't have zoom scopes in WWII)

To use the zoom scope, you must bind one key to +zoomin, and another key to +zoomout. To make it easier, I built in a routine so that players can simply enter a command in-console and the plugin will bind keys for the player. There is also a display while scoped to inform the player of the approximate zoom magnification and the available zoom commands. A 'default' zoom value can be set by entering the command setzoom while zoomed. After setting a default value, weapons will zoom to this value by default when a new weapon is obtaimed or you zoom after respawning (must be set on each map change). A default zoom value can also be set from your own user config file. Using this method will set a zoom value upon entering the server.

The scope will remain at the last used setting unless you change to a non-scoped primary weapon (or die of course). There is a very slight flicker when changing zoom settings. But it doesn't affect functionallity. Hopefully someone smarter than me can tell me how to get rid of this.

Commands:
+zoomin - Causes the scope to zoom in
+zoomout - Causes the scope to zoom out
setzoom - Sets the default zoom value to the current zoom value
zoombindpg - Binds the keys PageUp to +zoomin and PageDown key to +zoomout
zoombindmw - Binds the mousewheel to zoom in and out

CVars:
zoomscopes_enable <0|1> Disables|Enables the plugin (default 1)
zoomscopes_info_enable <0|1> Disables|Enables the zoom display (default 1)

User Vars:
set_zoomscope <##> Sets the default zoom from a user config. This will set your default zoom upon entering the server. It is preferrable to set this value in a user config file (such as autoexec.cfg or userconfig.cfg). Howeverm it can be set or changed in the console.
The syntax is: setinfo set_zoomscope ##
The ## value must be from 10 - 36. Normal zoom is 20. The lower the value, the closer (more magnified) the view. So a value of 10 is fully zoomed in. (Not that it matters, but I use a value of 17).

Revisions:
NOTE: Recommend placing this plugin ahead of others plugins that create
HUD meaasges upon death (ie: stats)
1.6 Added user CVar to set player's default zoom from a player's config file
- Fixed 'setzoom' command to only set if actually zoomed
1.5 Fixed that you couldn't set default zoom for the Scoped_Enfield
1.4 Added ability to set a default zoom value
1.3 Replaced scoped distance with zoom commands
- Fixed zooming if killed while zoomed
- Uses a dedicated channel for HUD message
1.21 - Fixed display appearing when dead

1.2 Original release

(updated 6-30-09)
.
Attached Files
File Type: sma Get Plugin or Get Source (dod_zoomscopes.sma - 1470 views - 7.9 KB)
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 06-30-2009 at 22:49.
Vet is offline
Send a message via MSN to Vet
|OnEHiTwOnDeR|
Member
Join Date: Apr 2007
Location: Los Angeles
Old 12-26-2007 , 10:28   Re: DOD variable zoom scopes
Reply With Quote #2

i love this dude..very nice its on my server now good job and thanks
__________________
|OnEHiTwOnDeR| is offline
Send a message via AIM to |OnEHiTwOnDeR|
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-03-2008 , 16:07   Re: DOD variable zoom scopes
Reply With Quote #3

The dod_zoomscopes plugin has been updated. Highlights are...

1) The plugin now allows you to set a default zoom value. This means, if you typically zoom to the same value, you can make that value the default zoom value when you initially zoom your weapon after spawning or changing to a different zoomable weapon. This value resets to normal on map change. Of course, you can still change the zoom manually too.

2) The distance to target feature of the plugin was replaced by applicable/available zoom commands. This was done for several reasons. First, the distance feature was VERY resource intensive. Second, the value was just eye-candy and had no usefulness what-so-ever. Third, displaying the available commands helps players that are new to the plugin, learn how to operate/comtrol it.

3) Fixed zooming if killed while zoomed.
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 06-03-2008 at 16:11.
Vet is offline
Send a message via MSN to Vet
finswimmer6
New Member
Join Date: Aug 2008
Location: Greece
Old 08-27-2008 , 13:44   Re: DOD variable zoom scopes
Reply With Quote #4

I have just add the plugin "DOD variable zoom scopes" and works fine but since i enable the mouse weel zoom (with the zoombindmw command) i cant change weapon with the weel.

CVars:
zoomscopes_enable <0|1> Disables|Enables the plugin (default 1)
zoomscopes_info_enable <0|1> Disables|Enables the zoom display (default 1)

I put the CVars in cvars.ini and it looks like
; Menu configuration file
; File location: $moddir/addons/amxmodx/configs/cvars.ini
; To use with Commands Menu plugin

; Cvars Menu:
; < cvar > < values > ... < access level >

"mp_timelimit" "0" "30" "45" "u"
"sv_password" "" "mypw" "clanwar" "u"
"pausable" "0" "1" "u"
"sv_voiceenable" "0" "1" "u"
"mp_chattime" "0" "1" "3" "u"
"mp_friendlyfire" "0" "1" "u"
"mp_allowspectators" "0" "1" "u"
"mp_flashlight" "0" "1" "u"
"mp_deathmsg" "0" "1" "u"
"mp_fadetoblack" "0" "1" "u"
"mp_tkpenalty" "0" "3" "6" "u"
"mp_spawnbazookas" "0" "1" "u"
"mp_limitalliesgarand" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitalliescarbine" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitalliesthompson" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitalliesgreasegun" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitalliesspring" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitalliesbar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitallies30cal" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitalliesbazooka" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitalliesmortar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxiskar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxisk43" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxismp40" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxismp44" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxisscopedkar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxisfg42" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxisfg42s" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxismg34" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxismg42" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_combinemglimits" "0" "1" "u"
"mp_limitaxispschreck" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitaxismortar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitbritlight" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitbritassault" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitbritsniper" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitbritmg" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitbritpiat" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
"mp_limitbritmortar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
zoomscopes_enable <0|1> Disables|Enables the plugin (default 1)
zoomscopes_info_enable <0|1> Disables|Enables the zoom display (default 1)


but i think that is not right because it didn't work So where i must put these cvars to enable/disable the plugin?
finswimmer6 is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 08-27-2008 , 23:05   Re: DOD variable zoom scopes
Reply With Quote #5

The CVars can be placed in any config that gets read upon server startup or mapchange depending on how you want to activate them. Personally, I place then in either my server.cfg or amxx.cfg. The plugin will default to 'on' and to display the zoom amount. So unless you want to change those settings, there's no real need to enter the CVars into any config.

As for the mwheel, running the command will replace the original binds with zoom binds. To return to what you had, you'll have to manually rebind the keys. I use the mwheel to change weapons too. So mine are bound to 'invnext' and invprev'.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
finswimmer6
New Member
Join Date: Aug 2008
Location: Greece
Old 08-28-2008 , 05:20   Re: DOD variable zoom scopes
Reply With Quote #6

Thank you very much. I will try this
Good job!
finswimmer6 is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 03-08-2009 , 20:17   Re: DOD variable zoom scopes
Reply With Quote #7

Version update:
I fixed a situation where if you set a default zoom amount while using the Scoped Enfield, it wasn't retained for the next life.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-30-2009 , 22:50   Re: DoD Variable-Zoom Scopes
Reply With Quote #8

Version update:
- Added user CVar to set player's default zoom from a player's config file
- Fixed 'setzoom' command to only set if actually zoomed
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:58.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode