AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] laser sight crosshair removal updated: 06/29 (https://forums.alliedmods.net/showthread.php?t=110803)

gowness 12-03-2009 06:01

[L4D2] laser sight crosshair removal updated: 06/29
 
2 Attachment(s)
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


DieTeetasse 12-03-2009 07:26

Re: [L4D2] laser sight crosshair removal
 
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.

gowness 12-03-2009 08:10

Re: [L4D2] laser sight crosshair removal
 
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.

thejuice027 12-04-2009 00:10

Re: [L4D2] laser sight crosshair removal
 
I put this on my server, But its not working :cry:

gowness 12-04-2009 00:28

Re: [L4D2] laser sight crosshair removal
 
Quote:

Originally Posted by thejuice027 (Post 1006678)
I put this on my server, But its not working :cry:

you did remember to install sdkhooks right?

billabonker 12-04-2009 06:37

Re: [L4D2] laser sight crosshair removal
 
Quote:

Originally Posted by gowness (Post 1006681)
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

alexip121093 12-04-2009 10:16

Re: [L4D2] laser sight crosshair removal
 
this laser sight crosshair removal not work when you use this command
upgrade_add LASER_SIGHT
can you fix this?

GM-Scorp 12-04-2009 15:28

Re: [L4D2] laser sight crosshair removal
 
Quote:

Originally Posted by billabonker (Post 1006772)
sdkhooks comes with every sourcemod version

what are you saying here

that you didn't install SDKhooks and its working like it should ?

gowness 12-04-2009 15:37

Re: [L4D2] laser sight crosshair removal
 
Quote:

Originally Posted by billabonker (Post 1006772)
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 (Post 1006864)
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

thejuice027 12-05-2009 16:35

Re: [L4D2] laser sight crosshair removal
 
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.


All times are GMT -4. The time now is 14:03.

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