#include <sdktools_entinput>
#define SZF(%0) %0, sizeof(%0)
Handle hTimer;
int iWeapon;
public void OnPluginStart()
{
iWeapon = FindSendPropInfo("CBaseCombatWeapon", "m_hOwnerEntity");
}
public void OnMapStart()
{
hTimer = CreateTimer(30.0, timer_del_snow, _, TIMER_REPEAT);
}
public void OnMapEnd()
{
delete hTimer;
}
Action timer_del_snow(Handle timer)
{
int iMaxEntities = GetMaxEntities();
char sWeapon[64];
for(int i = MaxClients; i < iMaxEntities; i++)
{
if(IsValidEdict(i) && IsValidEntity(i))
{
GetEdictClassname(i, sWeapon, sizeof sWeapon);
if((StrContains(sWeapon, "weapon_snowball") != -1) && GetEntDataEnt2(i, iWeapon) == -1)
{
RemoveEdict(i);
}
}
}
return Plugin_Continue;
}
public Action CS_OnCSWeaponDrop(int iClient, int iWeapon)
{
char sWeapon[32]; GetEdictClassname(iWeapon, SZF(sWeapon));
if(StrEqual(sWeapon, "weapon_snowball"))
{
AcceptEntityInput(iWeapon, "Kill");
}
return Plugin_Continue;
}