AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remove the Crosshair (https://forums.alliedmods.net/showthread.php?t=45328)

Wilson [29th ID] 09-29-2006 17:56

Remove the Crosshair
 
I have coded a modification for Day of Defeat that gives players Ironsights on their weapons. The only thing preventing me from releasing it is because it requires a client-side package. This package includes customxhair.spr which has one of the crosshairs as "blank" or transparent completely.

This is the only way I know of to remove the crosshair from Day of Defeat.


Does anyone know another way? Any kind of hint, clue, trail...I'll do all the work but does anyone know a possibility?

The message HideWeapon works, but it also disables all recoil.
The message Crosshair does nothing in Day of Defeat.
hud_draw 0 works, but after you jump you cannot shoot again.

There's gotta be something I'm missing. Even if I display a sprite on the users hud to go over their crosshair - does anyone know a way?

DiscoBBQ 09-29-2006 23:49

Re: Remove the Crosshair
 
Execute the "Crosshair 0" on the player; Likewise when they disconnect or map change make sure to have them turned back to "Crosshair 1".

Wilson [29th ID] 09-30-2006 00:23

Re: Remove the Crosshair
 
That might work in CS, but it does nothing in dod.

VEN 09-30-2006 02:50

Re: Remove the Crosshair
 
Did you tryed bits from (1<<0) to (1<<7) for HideWeapon? Most of the bits should be mod-specific, i.e. different that CS, so you have to check it yourself for DoD. Also there may be a specail message like HideCrosshair or something else. Type "meta game" in the server console and try to search for the appropriate message name.

Wilson [29th ID] 09-30-2006 08:40

Re: Remove the Crosshair
 
Actually when I put simple integers, 1 through 17, they all did something in HideWeapon. But when I did 1<<# any number only #1 did something I believe.

I've actually looked through every Dod message and none seem to be it. I've even tried logging the ones I don't know and they are things other than crosshair. There has to be something though.

VEN 10-01-2006 04:03

Re: Remove the Crosshair
 
Note: you shouldn't pass an integers but a bits. So lets say there are 8 possible HUD elements that can be hidden. If you would test it with integers you'll have to check 255 integers while only 8 bits is needs to be checked. And, btw, i recommend you to pass 255 i.e. 1<<8 - 1, i.e. 1<<0|1<<1|...|1<<7 - this will allow you to check whether HideWeapon allows to hide the crosshair at all or not. Also a note, that 1<<2 bit could be a "hide all" so in this case you might want to exlude it as non-practical solution. I. e. (1<<8 - 1) & ~(1<<2) or 251

Edit:
Quote:

The message HideWeapon works, but it also disables all recoil.
Which value?

Wilson [29th ID] 10-04-2006 00:12

Re: Remove the Crosshair
 
Thanks for helping VEN. This is what i've got.

1<<0 - disable ammo, disable xhair, disable slot1 slot2 slot3 etc (does not disable objectives)
1<<1 - back to normal
1<<2 - disable entire hud even say text
1<<3 - back to normal
everything above - back to normal

Does anyone know how to display a sprite on the HUD? Over where the xhair would be? The same way a sniper scope is displayed?

This would solve so many problems. Even cure some diseases.

kyo 04-07-2007 17:00

Re: Remove the Crosshair
 
im not too good with all this server stuff but i have an idea how to get ride of the corsshairs.first youd fource a download (i have kno ideda how) of this sprite i have.then lock the cl_xhair_style at 1 and the cross hairs should be gone but like i said i dont kno if you can fource a download

kyo 04-07-2007 17:08

Re: Remove the Crosshair
 
http://files.filefront.com/no_crossh.../fileinfo.html

thats the file tht turns off the cosshair

zenix 04-07-2007 20:47

Re: Remove the Crosshair
 
kyo - To force a download, you could attempt to precache it, Steam would notice not on the client and download it before the user even enters the game. It is an idea that could be used succesfully.

Wilson - if the file isn't too big (1-10kb) downloading shouldn't be much of a problem for you users at all. Another question though, why do you even want the crosshairs gone at all?!?


All times are GMT -4. The time now is 04:54.

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