Quote:
Originally Posted by SoulWeaver16
This works o: Really thanks

But the version with a knife, it closes the game, I thought it was my model, but it works fine.
Maybe something should be corrected there.
|
Yeah, I had no idea how to handle that case correctly, so here I can't help you, sorry
Edit: try to add
iWeapon = -1 at the end of last
while. It crashes because of infinite 'while' (didn't notice that thing)
Or, simply, replace last function (CheckWeapons) with this fixed version:
PHP Code:
CheckWeapons(id, iSkipEnt = FM_NULLENT)
{
static iMaxWeapons; iMaxWeapons = g_iMaxWeapons
static iWeapon; iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_CBasePlayer[SECONDARY])
while(iWeapon > 0)
{
if(iWeapon == iSkipEnt || iMaxWeapons <= 0)
{
set_pev(iWeapon, pev_effects, EF_NODRAW)
}
else
{
if(get_pdata_int(iWeapon, m_iId, XO_CBASEPLAYERITEM) == CSW_USP)
{
if(get_pdata_int(iWeapon, m_fWeaponState, XO_CBASEPLAYERWEAPON) & WEAPONSTATE_USP_SILENCED)
{
set_pev(iWeapon, pev_body, USP)
}
else
{
set_pev(iWeapon, pev_body, USP_NoSil)
}
}
set_pev(iWeapon, pev_effects, 0)
--iMaxWeapons
}
iWeapon = get_pdata_cbase(iWeapon, m_pNext, XO_CBASEPLAYERITEM)
}
// Sure, this move is so stupid...
iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_CBasePlayer[KNIFE])
while(iWeapon > 0) // Player can have no knife...
{
if(iWeapon == iSkipEnt)
{
set_pev(iWeapon, pev_effects, EF_NODRAW)
}
// Not sure if we need to loop thru knives if player can have only one
//iWeapon = get_pdata_cbase(iWeapon, m_pNext, XO_CBASEPLAYERITEM)
iWeapon = 0
}
}
If knives won't work then I can't help you
__________________