Raised This Month: $12 Target: $400
 3% 

[CSS] Sniper rifle crosshair with no scope v1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author
cjsrk
Junior Member
Join Date: Mar 2023
Location: China
Plugin ID:
8423
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    display the crosshair when the sniper rifle is not on the scope
    Old 03-17-2023 , 09:22   [CSS] Sniper rifle crosshair with no scope v1.0
    Reply With Quote #1

    The plugin can show the crosshair when the sniper rifle is not on the scope. When your sniper rifle does not open the scope, it will display the crosshair in the center of your screen, and it will disappear automatically when the scope is opened, which does not affect the opening of the scope!
    Tested for css only and i don't know if it works for other games

    Features:
    1. Referring to Black Haze's code (https://forums.alliedmods.net/showthread.php?t=149750), I removed the cheat flag for the "r_screenoverlay" command. Now you can use this plugin even when cheat mode is not enabled! (stand-alone test passed, online has not been tested)

    2. This plugin is compatible with the hit feedback plugin and the kill feedback plugin. Now this plugin does not conflict with these two plugins and can be used with them.

    3. There are two types of crosshairs: red dots and CSS-like green crosshairs (please refer to the screenshot below for details). You can set the default style in the configuration file. You can also switch styles in-game using the console command "crosshair_switch".

    Commands:
    crosshair_switch - enable/disable the plugin
    crosshair_type - switch sniper rifle crosshair style (red dot / CSS-like green crosshair)

    Configuration file: cstrike/cfg/sourcemod/plugin.crosshair_with_noscope.cfg

    Cvars:
    sm_crosshair_with_noscope_enable
    Whether to enable the plugin
    0 = disabled
    1 = enabled

    sm_crosshair_with_noscope_type
    The crosshair style of the sniper rifle
    1 = red dot
    2 = the green crosshair imitating CSS

    sm_crosshair_with_noscope_time
    The time to temporarily disable the crosshair when injuring the enemy
    It is consistent with the time displayed by the hit feedback plugin, which is generally 0.15 or 0.1. If you do not install the hit feedback plugin, please fill in 0
    Default Values: 0

    sm_crosshair_with_noscope_time2
    The time to temporarily disable the crosshair when killing an enemy
    It same as the display time of the kill feedback plug-in, and the display time of the kill feedback plugin is generally 1.0-3.0. If you do not install the kill feedback plugin, please fill in 0
    Default Values: 0

    My English is not good, the expression may not be clear, please forgive me.
    Attached Thumbnails
    Click image for larger version

Name:	red dot.jpg
Views:	349
Size:	97.3 KB
ID:	199956   Click image for larger version

Name:	CSS-like green crosshair.jpg
Views:	220
Size:	97.0 KB
ID:	199957   Click image for larger version

Name:	the crosshair will disappear when the scope is op.jpg
Views:	232
Size:	87.4 KB
ID:	199958  
    Attached Files
    File Type: zip Sniper rifle crosshair with no scope v1.0.zip (2.72 MB, 359 views)
    File Type: sp Get Plugin or Get Source (Crosshair_With_Noscope.sp - 133 views - 10.7 KB)

    Last edited by cjsrk; 03-18-2023 at 01:24.
    cjsrk is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 03-17-2023 , 12:48   Re: [CSS] Sniper rifle crosshair with no scope v1.0
    Reply With Quote #2

    This variant would be much better, IMHO.
    Attached Files
    File Type: sp Get Plugin or Get Source (css_crosshair_with_noscope 1.1.0.sp - 187 views - 8.8 KB)
    __________________
    Grey83 is offline
    cjsrk
    Junior Member
    Join Date: Mar 2023
    Location: China
    Old 03-17-2023 , 20:49   Re: [CSS] Sniper rifle crosshair with no scope v1.0
    Reply With Quote #3

    May I ask what improvements have been made?
    cjsrk is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 03-19-2023 , 12:25   Re: [CSS] Sniper rifle crosshair with no scope v1.0
    Reply With Quote #4

    Quote:
    Originally Posted by cjsrk View Post
    May I ask what improvements have been made?
    Changes:
    • Only new syntax.
    • Removed deprecated flag FCVAR_PLUGIN in convars.
    • Changed name of config from plugin.crosshair_with_noscope.cfg to crosshair_with_noscope.cfg.
    • The plugin looks for "m_iFOV" offset before OnPluginStart() (and stops working if it can't be found).
    • Optimized work with console variables (and crosshair type is now bool).
    • Removed unneeded hook SDKHook_WeaponEquipPost (and hook SDKHook_WeaponSwitchPost don't used for bots).
      And the callback for SDKHook_*Post hooks is void, not Action!
    • The crosshair_switch and crosshair_type commands only switch modes for the player who used them, not for the entire server.
    • When the plugin is turned off by the console variable disables event hooks and SDKHook_WeaponSwitchPost.
    • Determining whether a player's current weapon has a scope has been moved to a separate function and slightly optimized.
    • Messages translated from Chinese to English.
    However, I think that using an overlay as a crosshair is not a very good idea due to a possible conflict with all other plugins that also use overlays.
    __________________

    Last edited by Grey83; 03-19-2023 at 12:25.
    Grey83 is offline
    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 01:22.


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