AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [TUT] Custom Weapon Hud Sprites + Slot Redirection (https://forums.alliedmods.net/showthread.php?t=175632)

K.K.Lv 01-07-2012 21:30

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
awesome man, that should be useful for me !

lucas_7_94 01-08-2012 03:40

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
i will say this , its fucking awesome , great work arkshine.

Arkshine 01-08-2012 04:25

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
Quote:

Originally Posted by hleV (Post 1627613)
Nice, but are you completely sure that you can only replace the already made weapons and not create new ones? In ESF (which is a mod and possibly uses some different weapon system) you can actually create new weapons by registering a command (like "weapon_new") to hook when the weapon is selected (or force the player to select it), writing certain messages and setting weapon's new ID (if the last ID for ESF is like 34, then for the new weapon it would be 35) in certain messages and of course setting up the weapon_new.txt file.

I don't know. The weapon system is the same as HL, thus hardcoded as hell. I don't think you can, but I've posted so people could test and finding better method. Will try something to make sure.

Quote:

Originally Posted by mabaclu (Post 1627630)
Can this be used to place a sprite in the player's screen? That way we could show an image without editing hud.txt

No, sadly. I've tried and it doesn't work. I've also check the client dll, and it checks the keywords listed in the tuto only. Others will be ignored.

Quote:

Originally Posted by NiHiLaNTh (Post 1627635)
Arkshine, I think that knife can be placed in first slot. I passed SlotID as 0 and NumberInSlot 1 and it worked, while setting both to 0 didnt drawed sprite in HUD.

Edit. Is it possible to change crosshair ?
I mean I passed it in .txt file and precached the sprite.But the original CS crosshair appeared. I was trying to hide crosshair with HideWeapon event but I failed.

Edit2. Maybe you explain what each parameter does? Especially, someone maybe confused with flags parameter(since you can add some flags to the weapon).

Playing with the position could make the trick, but I've noticed also it doesn't work well if you modify the position. The whole thing sounds tricky for some weapon. Keep up testing.

About crosshair, it seems the keyword "crosshair" is a second crosshair you can added and not replacing the original.

Will explain the parameters another time. Thanks.

NiHiLaNTh 01-08-2012 06:11

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
OK, will do some testing in there.

P.S. You can also pass ammo2 keyword for the secondary ammo type.Using it together with

Code:

byte  SecondaryAmmoID    byte  SecondaryAmmoMaxAmount
you draw secondary ammo type above primary.But there is one bug, secondary HUD ammo over-draws the money HUD.The only way how to fix that is to hide money HUD. :(

wangningyu 01-08-2012 08:19

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
thanks for share !

pRoxxxDD 01-09-2012 14:59

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
It was actualy one year ago. :)

pRoxxxDD 01-09-2012 16:24

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
Quote:

Originally Posted by bboygrun (Post 1627668)
I saw that the crosshair can be changed when you zoom with a weapon ( Awp, scout ... ) but it doesn't work like you if i don't zoom or if i have a weapon without a zoom.

You answer on your question, just set FoV 89 (Standart no Zoom is 90) to player, and you'll see the new crossfire.:)

To Arkshine, C.S. sends Weapon List as MSG_INIT (This mean message sends one time on connect), if you want change sprite for ever just send your message one time on connect, otherwise you must send
it every time you want change it. =)

Arkshine 01-09-2012 17:11

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
I'm well aware this message is sent one time but that's would lose the purpose to be dynamic & per player, which would be what want coder for most of them. But it's true I could add a section for the situation all players all the time.

Kiske 01-12-2012 13:08

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
I need to show icon if player has hud_fastswitch 1, is that possible?

dias 01-13-2012 18:49

Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
 
Does it work on client-side ?


All times are GMT -4. The time now is 06:17.

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