Here is my code
PHP Code:
public Action Command_Drop(int client, const char[] command, int args)
{
if(IsValidClient(client))
{
char sName[32];
int weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if(!IsValidEdict(weapon))
return Plugin_Continue;
GetEdictClassname(weapon, sName, sizeof(sName));
if(StrEqual("weapon_taser", sName, false))
{
if(GetEntProp(weapon, Prop_Data, "m_iClip1") > 0)
{
int iSequence = GetEntProp(weapon, Prop_Data, "m_nSequence");
if(iSequence != 2)
{
SDKHooks_DropWeapon(client, weapon);
return Plugin_Handled;
}
}
}
else if(StrEqual("weapon_hegrenade", sName, false) || StrEqual("weapon_flashbang", sName, false) || StrEqual("weapon_smokegrenade", sName, false) || StrEqual("weapon_incgrenade", sName, false) || StrEqual("weapon_molotov", sName, false) || StrEqual("weapon_tagrenade", sName, false) || StrEqual("weapon_decoy", sName, false))
{
int iSequence = GetEntProp(weapon, Prop_Data, "m_nSequence");
if(iSequence != 2)
{
SDKHooks_DropWeapon(client, weapon);
return Plugin_Handled;
}
}
else if((StrContains(sName, "knife", false) != -1) || (StrContains(sName, "bayonet", false) != -1))
{
SDKHooks_DropWeapon(client, weapon);
return Plugin_Handled;
}
}
return Plugin_Continue;
}