|
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
|
09-25-2023
, 14:34
Re: [TUT] Custom Weapon Hud Sprites + Slot Redirection
|
#108
|
Quote:
Originally Posted by Supremache
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_ItemSlot, WEAPON_BASE_ENT, "@Ham_CBasePlayer_ItemSlot");
@Ham_CBasePlayer_ItemSlot( const item )
{
SetHamReturnInteger(SLOT_ID + 1);
return HAM_SUPERCEDE;
}
public fw_Item_AddToPlayer_Post(ent, id) {
switch(entity_get_int(ent, EV_INT_impulse)) {
case 0: UTIL_Weaponlist(id, WEAPON_BASE_ENT, PRI_AMMO_ID, 90, 0, 1, WEAPON_BASE_CSW, 0);
case WEAPON_SPECIAL_KEY: UTIL_Weaponlist(id, WEAPON_SPRITE_NAME, PRI_AMMO_ID, WEAPON_AMMO, SLOT_ID, NUM_IN_SLOT, WEAPON_BASE_CSW, ITEM_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
You're right Metalicross
|
|
|
|
|