Raised This Month: $32 Target: $400
 8% 

[L4D2] laser sight crosshair removal updated: 06/29


Post New Thread Reply   
 
Thread Tools Display Modes
Author
gowness
Junior Member
Join Date: Nov 2009
Plugin ID:
1308
Plugin Version:
1.1.6
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Removes crosshair while holding a laser-equiped weapon
    Old 12-03-2009 , 06:01   [L4D2] laser sight crosshair removal updated: 06/29
    Reply With Quote #1

    What does it do?
    while a player is holding a gun that has a laser sight, it will remove the crosshairs and leave you with the red dot. It automatically re-enables and re-disables the laser sight as the player switches from their primary weapons to others.


    Please make sure your sdkhooks is update:
    http://forums.alliedmods.net/showthread.php?t=106748


    This is my first true plugin, made in response to http://forums.alliedmods.net/showthread.php?t=109979 . Currently everything seems to be working, but i wouldn't be surprised if bugs pop up, especially in versus.


    TODO
    • Check for survivor release.
    • remove sdkhooks dependency
    • client command to leave crosshairs on.

    known compatibility issues

    Currently i have a few ideas for removing the sdkhooks necessity, but any suggestions would be appreciated


    ChangeLog

    Code:
    1.0.0
        * initial release
    1.0.5
        * hooked upgrade_add to detect manually giving a laser sight
    1.1.0
        * fixed some sdkhook crashes
        * no more per-client variables, but per-weapon variable, seems to work perfectly. 
        * fixes the problem of dropping weapons with lasers and picking up ones that don't.
    1.1.6
        *this version had addressed the map change situation, but updates seem to have broken that.
        *seems to work on most recent update, so i'm going ahead and releasing it
    1.2
        *fixed some weapon detections
        *added exception for awp
        *added upgrade_remove hook
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_laser_crosshair_removal.sp - 2200 views - 7.7 KB)
    File Type: smx l4d2_laser_crosshair_removal.smx (5.4 KB, 2668 views)

    Last edited by gowness; 06-30-2010 at 02:25. Reason: update
    gowness is offline
    DieTeetasse
    Senior Member
    Join Date: Jul 2009
    Old 12-03-2009 , 07:26   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #2

    I didnt't test it, but there will be a crosshair if you pick up a weapon with laser sights.
    Somehow we need to remember which weapon already got the lasersights. With the command "GetPlayerWeaponSlot(client, 1);" we can log the entitynumber of the weapon and save it into an array. If then the user picks up a weapon, the event "weapon_pickup" will be fired, that contains the entitynumber so we can compare them.
    DieTeetasse is offline
    gowness
    Junior Member
    Join Date: Nov 2009
    Old 12-03-2009 , 08:10   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #3

    Ah, thats what triggers the weapon pickup, i was originally trying to use that for the picking-up of new weapons, but realized that wasn't triggering. As for the remembering what weapons have lasers, that will probably be the second thing i do after removing the need for sdkhooks, and any major bugs that come up.
    gowness is offline
    thejuice027
    Senior Member
    Join Date: Dec 2009
    Old 12-04-2009 , 00:10   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #4

    I put this on my server, But its not working
    thejuice027 is offline
    gowness
    Junior Member
    Join Date: Nov 2009
    Old 12-04-2009 , 00:28   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #5

    Quote:
    Originally Posted by thejuice027 View Post
    I put this on my server, But its not working
    you did remember to install sdkhooks right?
    gowness is offline
    billabonker
    Senior Member
    Join Date: May 2009
    Old 12-04-2009 , 06:37   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #6

    Quote:
    Originally Posted by gowness View Post
    you did remember to install sdkhooks right?
    sdkhooks comes with every sourcemod version

    oh and a suggestion

    lets say if they pick up laser sight
    theres a cmd to it
    cl_crosshair_alpha
    if there was a way if they pick up laser sight
    the cvar would change to cl_crosshair_alpha 255
    __________________
    Please try out my server!

    drak.ath.cx:27015 is my Server's IP Server!

    Currently : OFFLINE

    Last edited by billabonker; 12-04-2009 at 08:35.
    billabonker is offline
    alexip121093
    Senior Member
    Join Date: Dec 2009
    Location: Hong Kong
    Old 12-04-2009 , 10:16   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #7

    this laser sight crosshair removal not work when you use this command
    upgrade_add LASER_SIGHT
    can you fix this?
    alexip121093 is offline
    Send a message via MSN to alexip121093
    GM-Scorp
    Senior Member
    Join Date: Jun 2009
    Location: netherlands
    Old 12-04-2009 , 15:28   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #8

    Quote:
    Originally Posted by billabonker View Post
    sdkhooks comes with every sourcemod version
    what are you saying here

    that you didn't install SDKhooks and its working like it should ?
    __________________
    GM-Scorp is offline
    Send a message via MSN to GM-Scorp
    gowness
    Junior Member
    Join Date: Nov 2009
    Old 12-04-2009 , 15:37   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #9

    Quote:
    Originally Posted by billabonker View Post
    lets say if they pick up laser sight
    theres a cmd to it
    cl_crosshair_alpha
    if there was a way if they pick up laser sight
    the cvar would change to cl_crosshair_alpha 255
    I'm not sure i quite understand what you are asking.
    And i just checked..sdkhooks doesn't come with sourcemod. sdktools does.
    Quote:
    Originally Posted by alexip121093 View Post
    this laser sight crosshair removal not work when you use this command
    upgrade_add LASER_SIGHT
    can you fix this?
    Whoops, meant to add that to the todo.


    edit: updating to 1.0.5 which hooks the upgrade_add command for the laser sight

    Last edited by gowness; 12-04-2009 at 18:54.
    gowness is offline
    thejuice027
    Senior Member
    Join Date: Dec 2009
    Old 12-05-2009 , 16:35   Re: [L4D2] laser sight crosshair removal
    Reply With Quote #10

    I tried again, doesn't work. I have the hooks

    I am using this plugin to spawn the laser sight
    http://forums.alliedmods.net/showthread.php?p=993960

    EDIT: I got it working when I pick it up in a real spawn location, but it also removes the crosshair on the Magnum, which makes it very difficult to aim.

    Last edited by thejuice027; 12-06-2009 at 01:05.
    thejuice027 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 02:19.


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