"game_type" = "0"
"game_mode" = "0"
Iteration code is written in c++:
PHP Code:
void CPlayer::OnPlayerRunCmd(CUserCmd* /*cmd*/, void* /*moveHelper*/)
{
for(int i = 0; i != MAX_WEAPONS_CSGO; ++i)
{
CBaseEntity* weapon = GetMyWeaponHandle(i);
if(!weapon)
continue;
std::string name(weapon->GetClassName());
if (name.rfind("weapon_", 0) == 0)
continue;
if (name.rfind("item_", 0) == 0)
continue;
const int index = weapon->Index();
LogMsg("Improper item \"%s\" with index %i in the invenory of %s", name.c_str(), index, GetName());
}
RETURN_META(MRES_IGNORED);
}
Here is what under the hood of the GetMyWeaponHandle function:
PHP Code:
CFakeHandle& CBaseCombatCharacter::GetMyWeaponHandle(int index) const
{
return m_hMyWeapons[index];
}
PHP Code:
class CFakeHandle : public CBaseHandle
{
public:
operator CBaseEntity* () const
{
if (!IsValid())
return nullptr;
const int index = GetEntryIndex();
const cell_t ref = gamehelpers->IndexToReference(index);
if(ref == -1)
return nullptr;
return gamehelpers->ReferenceToEntity(ref);
}
};