Raised This Month: $7 Target: $400
 1% 

[ANY] Binoculars


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Plugin ID:
2972
Plugin Version:
3.0
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    3 
    Plugin Description:
    Allows you to use binoculars with !binoculars command in chat.
    Old 05-26-2012 , 17:07   [ANY] Binoculars
    Reply With Quote #1

    Current Version: 3.0


    Description:

    Allows you to use binoculars with !binoculars command in chat.


    Cvars:
    Put in server.cfg
    Code:
    sm_binoculars_zoom "15" // zoom level for binoculars.
    
    sm_binoculars_shots 0  // Allow or disallow shots while using binoculars. 1 = allow. 0 = disallow.
    
    sm_binoculars_adminflag 0 // Admin flag required to use binoculars. 0 = No flag needed.

    Commands:

    sm_binoculars - Use binoculars.

    You can bind this commands, for example:

    bind p sm_binoculars


    Enjoy!


    Last version views: 196


    Donations (optional):

    If you apreciate my work, you can donate me via paypal or with a trade offer


    Download:

    Main repository
    Direct download
    Code changes
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 12-20-2015 at 09:46. Reason: fb given
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    MasterOfTheXP
    Veteran Member
    Join Date: Aug 2011
    Location: Cloudbank
    Old 05-26-2012 , 18:48   Re: [ANY] Binoculars
    Reply With Quote #2

    Using FOV for makeshift binoculars...clever. Veeeery clever.

    Perhaps add an override so only clients with a certain flag can use it.
    __________________
    Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
    MasterOfTheXP is offline
    Fearts
    ferts of daeth
    Join Date: Oct 2008
    Old 05-26-2012 , 23:15   Re: [ANY] Binoculars
    Reply With Quote #3

    Cool stuff
    __________________
    Fearts is offline
    Sevi_FyA
    Member
    Join Date: Jul 2011
    Location: Seville
    Old 05-27-2012 , 03:28   Re: [ANY] Binoculars
    Reply With Quote #4

    Esto lo tengo que probar Francisco

    Edit: Lo he probado Francisco en mi server y prefiero que no se pueda disparar cuando esta activado los prismaticos, sino creo yo que deja de ser prismaticos para ser Zoom de armas

    Last edited by Sevi_FyA; 05-27-2012 at 04:04.
    Sevi_FyA is offline
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 05-27-2012 , 06:40   Re: [ANY] Binoculars
    Reply With Quote #5

    Testing new version:

    -new cvar: sm_binoculars_shots 0 - Allow or disallow shots while using binoculars. 1 = allow. 0 = disallow.

    -new cvar: sm_binoculars_adminflag 0 - Admin flag required to use binoculars. 0 = No flag needed.


    Please, test it and tell me if this works fine for put in the first post


    Edit: now tested, use the attached of first post
    Attached Files
    File Type: sp Get Plugin or Get Source (binoculars.sp - 967 views - 2.7 KB)
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 05-27-2012 at 08:51.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 05-27-2012 , 08:48   Re: [ANY] Binoculars
    Reply With Quote #6

    New version 2.0

    -new cvar: sm_binoculars_shots 0 - Allow or disallow shots while using binoculars. 1 = allow. 0 = disallow.

    -new cvar: sm_binoculars_adminflag 0 - Admin flag required to use binoculars. 0 = No flag needed.

    -bug fixeds
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 05-27-2012 at 08:48.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 05-27-2012 , 13:17   Re: [ANY] Binoculars
    Reply With Quote #7

    New version 2.1

    -Bug fixed (found that 0 is also normal IFOV vision )
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 05-27-2012 at 13:18.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Zephyrus
    Cool Pig B)
    Join Date: Jun 2010
    Location: Hungary
    Old 05-27-2012 , 14:23   Re: [ANY] Binoculars
    Reply With Quote #8

    you should add a nice overlay to simulate an actual binocular and it will be even more awesome
    __________________
    Taking private C++/PHP/SourcePawn requests, PM me.
    Zephyrus is offline
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 05-27-2012 , 16:01   Re: [ANY] Binoculars
    Reply With Quote #9

    Quote:
    Originally Posted by Zephyrus View Post
    you should add a nice overlay to simulate an actual binocular and it will be even more awesome
    Yes, already they asked me, then I will try to add good overlay

    btw, proposals are supported for overlays
    __________________
    Veteran Coder -> Activity channel
    Coding on CS2 and taking paid and free jobs.

    Contact: Steam, Telegram or discord ( franug ).

    You like my work? +Rep in my steam profile comments or donate.

    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Calystos
    Member
    Join Date: Jan 2011
    Location: Terra
    Old 05-28-2012 , 06:04   Re: [ANY] Binoculars
    Reply With Quote #10

    This won't work on Nuclear Dawn as there is no "weapon_zoom" event to hook into (though it does exist in the "nucleardawn/modevents.res" file, under "cstrikeevents" list, but not in the "nucleardawn/resource/ModEvents.res"). Though there are of course some sorta event along that path since there are sniper scope weapons ingame (ironsights I think). Not sure what its alternate name is on ND. Am looking into it when I get a bit more time though, less someone beats me to it, ;)

    EDIT: Long as the weapon_zoom hook is ignored/disabled this does work on ND, Though it does ignore the binoculars/attack ignore setting (it spams chat with you can't attack messages but still shoots).

    Quick hack attached for ND users, will ignore weapon_zoom event hook. Its a dirty hack but least it works on ND,
    Oh an all I did was change the hook line to the following:
    Code:
        new String:modname[30];
        GetGameFolderName(modname, sizeof(modname));
        if (!StrEqual(modname, "nucleardawn", false))
        {
             HookEvent("weapon_zoom", EventWeaponZoom);
        }
    EDIT: Found another glitch, when (in ND this obviously) you right-click to use normal weapons zoom scope (if it has one) and shoot, it spams chat with you can't attack while using binoculars text too. Am guessing it'll be sorted if we can find out what ND uses instead of "weapon_zoom" as the event name.

    EDIT: Just had the same problem of no "weapon_zoom" in TF2 also btw.
    Attached Files
    File Type: sp Get Plugin or Get Source (binoculars.sp - 1025 views - 3.0 KB)

    Last edited by Calystos; 05-28-2012 at 07:32.
    Calystos is offline
    Send a message via ICQ to Calystos Send a message via AIM to Calystos Send a message via MSN to Calystos Send a message via Yahoo to Calystos Send a message via Skype™ to Calystos
    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 23:17.


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