This should be used for blocking specific players from planting the bomb, or specific bombsites.
PHP Code:
public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2])
{
if (buttons & IN_ATTACK || buttons & IN_USE)
{
if (weapon != -1)
{
char classname[65];
if (GetEntityClassname(weapon, classname, sizeof(classname)))
{
if (StrEqual(classname[7], "c4", true))
{
if (GetEntProp(client, Prop_Send, "m_bInBombZone"))
{
if (buttons & IN_ATTACK) buttons &= ~IN_ATTACK;
else if (buttons & IN_USE) buttons &= ~IN_USE;
PrintToChat(client, "You cannot plant the bomb in this bombsite!");
return Plugin_Changed;
}
}
}
}
}
return Plugin_Continue;
}
If you want to disable completely the bomb plant, then disable/remove all bombsites.
PHP Code:
public void OnMapStart()
{
int entity = -1;
while ((entity = FindEntityByClassname(entity, "func_bomb_target")) != -1)
{
AcceptEntityInput(entity, "Disable"); // or "Kill"
}
}
__________________