damn that worked better than I expected.
thanks m8
okay, so here's an updated version of your logic, looping through every weapon the client has:
PHP Code:
stock int GetWeaponEntityIndexByClassname(int iClient, char[] sWeapon_Classname)
{
for (int i = 0; i < 4; i++)
{
int iWeapon_Entity_Index = GetPlayerWeaponSlot(iClient, i);
if (iWeapon_Entity_Index != -1)
{
int iEntity = -1;
while ((iEntity = FindEntityByClassname(iEntity, sWeapon_Classname)) != INVALID_ENT_REFERENCE)
{
if (iWeapon_Entity_Index == iEntity)
return iEntity;
}
}
}
return -1;
}
__________________
I do make plugins upon requests, so hit me up on discord if you're interested: Stefan Milivojevic#5311