Well, I'll expand my problem a bit
I've been trying to hook OnTakeDamage and check if the one who dealt damage had a usp with a silencer equiped.
Trying to implement what you suggested I now have this:
PHP Code:
public Action:TakeDamageHook(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
new Ent = -1;
if((victim > 0) && (victim <= MaxClients) && (attacker > 0) && (attacker <= MaxClients) && (IsClientInGame(victim)) && (IsClientInGame(attacker)) && (GetClientTeam(victim) == CS_TEAM_T) && (GetClientTeam(attacker) == CS_TEAM_CT))
{
decl String:WeaponName[64];
GetClientWeapon(inflictor, WeaponName, sizeof(WeaponName));
while ((Ent = FindEntityByClassname(attacker, "weapon_usp")) != -1)
{
if (StrEqual(WeaponName, "weapon_usp") && (GetEntProp(Ent, Prop_Send, "m_bSilencerOn") == 1)) //FindSendPropOffs("CWeaponUSP","m_bSilencerOn") == 1)
{
damage = 0.0;
return Plugin_Changed;
}
}
}
return Plugin_Continue;
}
Well, so far it just crashes the server when someone does dmg with a silenced usp
Well, I have never used
FindEntityByClassname or GetEntProp so, I'm guessing the the fault lies there
Edit: Silly me, copied the "while" even when I didnt need it . Fixed and solved
T.y. for the help