I quick made this. When player change team, plugin look all projectiles and infernos owned by player and destroy them. Molotov and incendiary gives sound bug tough, you hear burning flames at that point where it get destroyed. I'm sure this sound loop can stop but I don't have time to look at.
PHP Code:
#include <sdktools>
#include <sdkhooks>
public void OnPluginStart()
{
HookEventEx("player_team", player_team);
}
public void player_team(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client == 0 || !IsClientInGame(client))
{
return;
}
int ent = -1;
char clsname[64];
while((ent = FindEntityByClassname(ent, "*")) != -1)
{
if(!GetEntityClassname(ent, clsname, sizeof(clsname))) continue;
if(StrContains(clsname, "smokegrenade", false) != -1) continue;
if(StrContains(clsname, "_projectile", false) == -1 && !StrEqual(clsname, "inferno", false)) continue;
if( client == GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity") )
{
//PrintToServer("Kill ent %i %s", ent, clsname);
AcceptEntityInput(ent, "Kill");
}
}
}
/*
public void OnEntityCreated(int entity, const char[] classname)
{
PrintToServer("classname %s", classname);
}
*/
__________________