View Single Post
Author Message
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 08-12-2017 , 18:46   [csgo] defuse a bomb planted outside a default map bombspot
Reply With Quote #1

With 'SDKHook_PostThink' & 'SetEntProp(client, Prop_Send, "m_bInBombZone", 1);' I'm able to create a bombzone.
So I can plant the bomb. But I can't defuse such a planted bomb.

I found 'SetEntProp(client, Prop_Send, "m_bInNoDefuseArea", 1/0);' but can't get it work.
Also found and tried to force: 'SetEntProp(client, Prop_Send, "m_bIsDefusing", 1);'.
I also tried to create and fire the events "bomb_begindefuse" & "bomb_defused" without success.

PHP Code:
#include <sourcemod>
#include <sdkhooks>

bool bBomb[MAXPLAYERS+1] = {true, ...};

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_PostThinkOnPostThink);
}

public 
void OnPostThink(int client)
{
    if (
bBomb[client])
    {
        
SetEntProp(clientProp_Send"m_bInBombZone"1);
        
SetEntProp(clientProp_Send"m_bInNoDefuseArea"0);  // also tested '1'
    
}

PHP Code:
    Event event CreateEvent("bomb_begindefuse"true);
    
    
SetEventInt(event"userid"GetClientOfUserId(client));
    
SetEventBool(event"haskit"true);
    
FireEvent(event,true); 
any ideas?
__________________
coding & free software

Last edited by shanapu; 08-12-2017 at 18:49. Reason: format / readability
shanapu is offline