Raised This Month: $ Target: $400
 0% 

[TUT] Custom Weapon Hud Sprites + Slot Redirection


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 09-25-2023 , 14:34   Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
Reply With Quote #39

Quote:
Originally Posted by Supremache View Post
I've configured the slot redirection to put the RPG-7 in slot 4.
However, the RPG-7 does not appear in slot 4 as expected. Instead, it shows up in slots 1, 2, 3, and 5 without any issues.

I've double-checked my configuration files and scripts, but I can't figure out what's causing this problem. I would greatly appreciate it if someone could help me troubleshoot this issue and provide guidance on how to make the RPG-7 appear in slot 4 as intended.


PHP Code:
#define PRI_AMMO_ID 2
#define SLOT_ID 3
#define NUM_IN_SLOT 1
#define ITEM_FLAGS 0

RegisterHam(Ham_Item_ItemSlotWEAPON_BASE_ENT"@Ham_CBasePlayer_ItemSlot");
    
@
Ham_CBasePlayer_ItemSlot( const item )
{
    
SetHamReturnInteger(SLOT_ID 1);
    return 
HAM_SUPERCEDE;
}

public 
fw_Item_AddToPlayer_Post(entid) {
    switch(
entity_get_int(entEV_INT_impulse)) {
        case 
0UTIL_Weaponlist(idWEAPON_BASE_ENTPRI_AMMO_ID9001WEAPON_BASE_CSW0);
        case 
WEAPON_SPECIAL_KEYUTIL_Weaponlist(idWEAPON_SPRITE_NAMEPRI_AMMO_IDWEAPON_AMMOSLOT_IDNUM_IN_SLOTWEAPON_BASE_CSWITEM_FLAGS);
    }

Consider this information: https://wiki.alliedmods.net/CS_WeaponList_Message_Dump

Take a look to the NumberInSlot parameter: weapon_ak47 is listed in position 1, same as weapon_hegrenade. NumberInSlot should be changed to another unused position, like 4 (1=he, 2=fb, 3=sg)
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
 



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 11:41.


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