Exception reported: Property "m_iItemDefinitionIndex" not found (entity 327/weaponworldmodel)
Code:
public Action OnWeaponCanUse(client, weapon)
{
decl String:sweapon[64];
GetEdictClassname(weapon, sweapon, sizeof(sweapon));
new weaponindex = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
this error happens very rarely and crash server
after this code (EquipPlayerWeapon):
Code:
zweapon[client_index] = GetEntPropEnt(client_index, Prop_Data, "m_hActiveWeapon");
if (IsValidEntity(zweapon[client_index]))
{
RemovePlayerItem(client_index, zweapon[client_index]);
}
else zweapon[client_index] = -1;
then:
Code:
if(zweapon[client_index] != -1 && IsValidEntity(zweapon[client_index])) EquipPlayerWeapon(client_index, zweapon[client_index]);
what it is - weaponworldmodel?
how should i fix this?
Code:
zweapon[client_index] = GetEntPropEnt(client_index, Prop_Data, "m_hActiveWeapon");
char sweapon[64];
GetEdictClassname(zweapon[client_index], sweapon, sizeof(sweapon));
if (IsValidEntity(zweapon[client_index]) && StrContains(sweapon, "weapon_") != -1)
{
RemovePlayerItem(client_index, zweapon[client_index]);
}
else zweapon[client_index] = -1;
will fix crash?