Because you are hooking the weapon box.
Try finding it's containing weapons.
Code:
stock getWeaponBoxEnts(weaponBox, ents[], entSize) {
if(entSize < 1 || !pev_valid(weaponBox)) {
return 0;
}
new maxEnts = global_get(glb_maxEntities);
new numEnts = 0;
for(new ent = get_maxplayers() + 1; ent <= maxEnts && numEnts < entSize; ent++) {
if(pev_valid(ent) && pev(ent, pev_owner) == weaponBox) {
ents[numEnts++] = ent;
}
}
return numEnts;
}
Code:
// dropped weapon forward
new weapons[32];
new numWeapons = getWeaponBoxEnts(entid, weapons, sizeof(weapons));
new class[32];
for(new i = 0; i < numWeapons; i++) {
pev(weapons[i], pev_classname, class, charsmax(class));
client_print(id, print_chat, "Dropped %s", class);
}
__________________