View Single Post
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 #108

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