Raised This Month: $140 Target: $400
 35% 

[TUT] Custom Weapon Hud Sprites + Slot Redirection


Post New Thread Reply   
 
Thread Tools Display Modes
axfalcon
Junior Member
Join Date: Apr 2016
Old 04-24-2016 , 20:51   Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
Reply With Quote #91

Quote:
Originally Posted by meTaLiCroSS View Post
WeaponList is sent only one time per player, this means, if you overwrited the default (client) values of WeaponList and then you want them again, you should send the default values to the client for skipping this issue, not hard.

EDIT: For forcing a client to clean his WeaponList values, you can use the m_fKnownItem offset (which offset value is unknown), or use GetItemInfo with Orpheu and send to the player the default values of a single weapon.

For more info, search in the HLSDK.
Can you point me in the right direction please sir? I am looking to change the sprites and am thinking in 2 possible ways.

1. The client downloads my custom sprites to cstrike_downloads/sprites2 folder, and somehow have the server tell the client to execute those instead of normal client sprites.

2. Have the client download a sprites2 folder and extract it to their cstrike folder, and give them an executable that switches the names of the sprites/*.txt files over to reference the new sprites. The executable can toggle the sprites and sprites2 on and off so the user can select with one-click which sprites they want.

Thoughts?

Last edited by axfalcon; 04-24-2016 at 20:52.
axfalcon is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 07-03-2017 , 12:27   Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
Reply With Quote #92

Arkshine, It seems that if you enable the Ham_item_itemslot in the weapon entity, you can pick up other weapons that are on the floor using the same slot. I ran the tests with Scout, if you touch another gun, you can get it, so you get two primary weapons. The same problem occurs if Scout is on the floor and you're using another primary weapon.
__________________
Working with $$$ paid plugins. Contact below (ONLY FOR NEGOTIATIONS)
  • Skype: crazy.770
  • Steam: crazy770
  • Discord: CrazY.#5317
Check my Aliens vs. Predator: 177.54.156.162:27018
CrazY. is offline
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 08-09-2017 , 15:03   Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
Reply With Quote #93

Instead of using
Code:
RegisterHam( Ham_Item_AddToPlayer, "weapon_knife", "OnAddToPlayerKnife", .Post = true );
I just tested
Code:
public plugin_precache( ) {     register_message( get_user_msgid( "WeaponList" ), "msgWeaponList" ); } public msgWeaponList( msgID, msgDest, id ) {     if( get_msg_arg_int( 8 ) == CSW_C4 )     {         set_msg_arg_string( 1, "weapon_tripmine" );         set_msg_arg_int( 3, ARG_BYTE, get_pcvar_num( g_pTripMax ) );     } }

And it works the same way. Is there a reason why you chose to hook Ham_AddToPlayer and send message as opposed to changing the args in WeaponList itself?
Also, WeaponList seems to only be called once when map loads. Message can be unregistered in plugin_init

Last edited by vitorrossi; 08-09-2017 at 15:21.
vitorrossi is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-10-2017 , 03:30   Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
Reply With Quote #94

The answer is in your message. There is the static method if you plan to replace a weapon all the time and the dynamic method if you need conditions to replace a weapon.
__________________
Working on : CS Weapon Mod (72%) , MonsterAI (PAUSED),

Arkshine is offline
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 08-10-2017 , 07:26   Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
Reply With Quote #95

Ah yes I see it now. Thank you
vitorrossi is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-06-2018 , 13:02   Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
Reply With Quote #96

thanks for the tutorial
__________________
man_s_our 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 12:04.


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