#include <sdktools_functions>
#pragma newdecls required
#define CS_SLOT_C4 4 /**< C4 slot. */
public void OnPluginStart()
{
HookEvent("bomb_planted", Event_BombPlanted);
}
public void Event_BombPlanted(Event event, const char[] name, bool dontBroadcast)
{
for (int client = GetClientOfUserId(event.GetInt("userid")), weapon, i; i < CS_SLOT_C4; ++i)
{
if ((weapon = GetPlayerWeaponSlot(client, i)) != -1)
{
char classname[26];
GetEdictClassname(weapon, classname, sizeof(classname));
FakeClientCommand(client, "use %s", classname);
break;
}
}
}