return Plugin_Handled/Plugin_Stop doesn't work on some events.
A probably more clean way to prevent bomb defuse is to play around with the progress bar netprop.
Just use the War3Source native for that.
War3_Progressbar(client,iDuration);
public Action:Event_BeginPlant( Handle:event, const String:name[], bool:dontBroadcast )
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(bClientInDuel[client])
{
PrintHintText(client, "You can not plant the bomb while in a duel");
//max amount of iDuration is 15 seconds(CS:S/CS:GO limit). so you need to
//create a timer and re-apply it.
War3_Progressbar(client,15);
}
return Plugin_Continue;
}
or try playing around with
this:
SetEntPropFloat(bombent, Prop_Send, "m_flDefuseCountDown", 3.0);
If you wan't to stop bomb planting I think it's the best to do something like this(untested):
stock W3DenyBombPlant(client, bool:shouldDeny)
{
if(shouldDeny)
SDKHook(client, SDKHook_ThinkPost, OnThinkPost);
else
SDKUnhook(client, SDKHook_ThinkPost, OnThinkPost);
}
public OnThinkPost(entity)
{
SetEntProp(entity,Prop_Send,"m_bInBombZone",false);
}
Stop hostage rescue is easy:
new g_LeaderOffset = -1;
public OnPluginStart()
{
g_LeaderOffset = FindSendPropOffs("CHostage", "m_leader");
if(g_LeaderOffset == -1)
{
SetFailState("Failed to lookup CHostage::m_leader offset");
}
HookEvent("hostage_follows", OnHostageFollows, EventHookMode_Pre);
}
public Action:OnHostageFollows(Handle:event, const String:name[], bool:dontBroadcast)
{
new hostage = GetEventInt("hostage");
SetEntDataEnt2(hostage, g_LeaderOffset, 0);
return Plugin_Handled;
}