Ooookay, that's the current code. With and without
TR_pHit it's the same. No error logs. And I've debugged it enough to see, that it's executed on all players, but not all die - the last one stands alive. Here's the test code:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Insta Deagle HS", "1.0", "Flicker")
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_deagle", "onPrimaryAttack", true)
}
public onPrimaryAttack(ent)
{
new id = pev(ent, pev_owner)
new iTeam = get_user_team(id)
new clip = get_pdata_int(ent, 51, 4) // cs_get_weapon_ammo(get_pdata_cbase(id, 373))
if(!clip) return
new szTeam[15]
copy(szTeam, charsmax(szTeam), iTeam == 1 ? "CT" : "TERRORIST")
new ptr = create_tr2()
set_tr2(ptr, TR_iHitgroup, HIT_HEAD)
new Float:flDirection[3]
new players[32], num
get_players(players, num, "aeh", szTeam)
new iNum = num < 6 ? num : 6
for(new i; i < iNum; i++)
{
set_tr2(ptr, TR_pHit, players[i])
ExecuteHam(Ham_TraceAttack, players[i], id, 147.0, flDirection, ptr, DMG_NEVERGIB | DMG_BULLET)
client_print(id, print_chat, "Executed! %d / %d", i+1, iNum)
}
free_tr2(ptr)
}
And here is some image for the results:

Therefore it's something from the trie. Any suggestions anyone?
__________________