Hi,
1. Is there a way to hide custom entities same as we hide armoury_entity entities? By setting m_iCount to 0? When I mean 'hide' I don't mean remove.
2. Every time I get into the game for the first time and open a listen server, a lot of things don't load properly, such as:
- It doesn't properly load WeaponList, so my weaponbox entities don't get any ammo, until I restart the listen server and it works.
etc..
3.
And last, this code is not glowing the weapons I drop because of entity indexes getting messed up for some reason.
PHP Code:
public RoundStarted( ) // here we glow the weapon that we create
{
log_to_file( "Rarity.txt", "#1 iEnt: %d | Color: %d", WeaponBoxEntity, g_iDataWeapon[ Weapon_Rarity ], g_iDataWeapon[ Rarity_Damage ] );
set_pev( WeaponBoxEntity, pev_iuser2, g_iDataWeapon[ Weapon_Rarity ] );
GlowWeapon( WeaponBoxEntity, g_iDataWeapon[ Weapon_Rarity ] );
}
public @SetModel( iEnt, szModel[ ] )
{
if( ! pev_valid( iEnt ) )
return FMRES_IGNORED;
new szClassName[ 32 ];
pev( iEnt, pev_classname, szClassName, charsmax( szClassName ) );
if( ! equal( szClassName, "weaponbox" ) )
return FMRES_IGNORED;
new iRarity = pev( iEnt, pev_iuser2 );
log_to_file( "Rarity.txt", "#2 iEnt: %d | Color: %d | Class: %s", iEnt, iRarity, szClassName );
GlowWeapon( iEnt, iRarity );
return FMRES_IGNORED;
}
Debug logs:
Quote:
L 07/21/2018 - 15:53:27: #2 iEnt: 544 | Color: 0 | Class: weaponbox
L 07/21/2018 - 15:53:27: #1 iEnt: 544 | Color: 4
L 07/21/2018 - 15:54:05: #2 iEnt: 113 | Color: 0 | Class: weaponbox
|
So basically this is what happens:
I create a weaponbox whose ID is 544, assign pev_iuser2 a value of 4, then hook FM_SetModel, and for the same weapon, the ID is 113? And of course the value is 0 because it's unassigned. Why does this happen?
__________________