06/06/2020 - 16:06:48: [SM] Exception reported: Entity 1 (1) is invalid
06/06/2020 - 16:06:48: [SM] Blaming: pluginn.smx
06/06/2020 - 16:06:48: [SM] Call stack trace:
06/06/2020 - 16:06:48: [SM][0] GetEntPropArraySize
06/06/2020 - 16:06:48: [SM][1] Line 3122, pluginn.sp::RemoveAllWeapons
06/06/2020 - 16:06:48: [SM][2] Line 6302, pluginn.sp::functiondd
6302: RemoveAllWeapons(x);
code
PHP Code:
void RemoveAllWeapons(int client)
{
int length = GetEntPropArraySize(client, Prop_Send, "m_hMyWeapons");
for (int i = 0; i < length; i++)
{
int weapon = GetEntPropEnt(client, Prop_Send, "m_hMyWeapons", i);
if (weapon != -1)
{
RemovePlayerItem(client, weapon);
AcceptEntityInput(weapon, "KillHierarchy");
}
}
SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", -1);
}
what is problem?