Raised This Month: $ Target: $400
 0% 

Stop a bomb defusing


Post New Thread Reply   
 
Thread Tools Display Modes
Kigen
BANNED
Join Date: Feb 2008
Old 12-28-2008 , 02:47   Re: Stop a bomb defusing
Reply With Quote #21

Sorry, but that doesn't work because of the ordering of ProcessUserCmds and when my event function gets called and when m_nButtons is updated.

So let me put it out there.

m_nButtons updated from client
ProcessUserCmds done
Event function in SM called.
Repeat

So thus any changes I make to m_nButtons are ignored, because an update is received from the client.
Kigen is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 12-28-2008 , 03:18   Re: Stop a bomb defusing
Reply With Quote #22

Perhaps just change the player to their knife or something when they try to plant?
__________________
CrimsonGT is offline
pengy
Junior Member
Join Date: Dec 2008
Old 12-28-2008 , 14:22   Re: Stop a bomb defusing
Reply With Quote #23

bomb_begindefuse? If the user is not allowed to defuse then
bomb_abortdefuse in events
pengy is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 12-28-2008 , 15:45   Re: Stop a bomb defusing
Reply With Quote #24

An event is only a notification.
__________________
CrimsonGT is offline
Kigen
BANNED
Join Date: Feb 2008
Old 12-28-2008 , 22:01   Re: Stop a bomb defusing
Reply With Quote #25

Quote:
Originally Posted by CrimsonGT View Post
Perhaps just change the player to their knife or something when they try to plant?
What if they only have their knife?

Anyhow, it appears that bomb defusing is funky in simply blocking all other things like that. Basically I would force said player to switch but nothing would come of it, the defusing would go on uninterrupted.
Kigen is offline
Timiditas
Senior Member
Join Date: Apr 2009
Old 09-24-2009 , 20:15   Re: Stop a bomb defusing
Reply With Quote #26

I don't know if this has ever been solved, but its possible by poking around in the m_fFlags of the client.

m_flDefuseCountDown of the planted_C4 entity seems to store the point in GameTime, when the player started to defuse. It it is 0 after planting, and it is 0 again if the CT aborts the defusal.
Setting m_flDefuseCountDown of the planted_C4 entity to *doesnt matter what* defuses the bomb instantly. WTF??
m_flDefuseLength is obvious, but changes to it have no effect to the bomb or the defusing process whatsoever.

So it seems we are left with this:
PHP Code:
public bomb_begindefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if(!
May_defuse)
    {
        
SetEntProp(clientProp_Send"m_fFlags"8);
        
PrintHintText(client"You are not fulfilling the requirements to defusing");
    }
    else
    {
        
SetEntProp(clientProp_Send"m_fFlags"1);
    }

However this introduces a stupid looking and sounding glitch. The defusal is started and stopped until the player let go of the use key.
There doesn't seem to be any other way.

(Setting the Flags to 1 when he may defuse is important, otherwise the player must jump one time before another try will succeed)
__________________


Last edited by Timiditas; 09-24-2009 at 20:18.
Timiditas is offline
Kigen
BANNED
Join Date: Feb 2008
Old 09-24-2009 , 20:33   Re: Stop a bomb defusing
Reply With Quote #27

Wow, unexpected but nice to see someone is still interested in finding a way to stop the bomb defusing.

I wonder if I can find the plugin I was developing for this.

Meh, maybe I'll have to start from scratch but that's OK. I'll probably include this into the next version of KAC if it works and is agreeable.
Kigen is offline
Timiditas
Senior Member
Join Date: Apr 2009
Old 09-24-2009 , 20:44   Re: Stop a bomb defusing
Reply With Quote #28

You thought of something like this?
PHP Code:
public bomb_planted(Handle:event, const String:name[], bool:dontBroadcast)
{
    
BombLocation[0] = 0.0BombLocation[1] = 0.0BombLocation[2] = 0.0;
    new 
bombent FindEntityByClassname(-1,"planted_c4");
    if (
bombent != -1)
        
GetEntPropVector(bombentProp_Send"m_vecOrigin"BombLocation);
    if((
BombLocation[0]+BombLocation[1]+BombLocation[2]) == 0.0)
        
LogError("[C4_defusefix] - Error locating C4!");
}

public 
bomb_begindefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid")), Float:Lookat[3], Float:fDiff[4];
    
Trace(client);
    
TR_GetEndPosition(LookatINVALID_HANDLE);
    for(new 
03;I++)
    {
        if(
Lookat[i] > BombLocation[i])
            
fDiff[i] = Lookat[i] - BombLocation[i];
        else
            
fDiff[i] = BombLocation[i] - Lookat[i];
    }
    
fDiff[3] = fDiff[0] + fDiff[1] + fDiff[2];
    if(
fDiff[3] > 10.0)
    {
        
SetEntProp(clientProp_Send"m_fFlags"8);
        
PrintHintText(client"You must see the C4 to defuse it");
    }
    else
    {
        
SetEntProp(clientProp_Send"m_fFlags"1);
    }

I tried to let the trace hit the planted_C4 directly, but for some reason or another, the ray goes through the C4 and always hits the world entity.
__________________

Timiditas is offline
Kigen
BANNED
Join Date: Feb 2008
Old 09-24-2009 , 20:47   Re: Stop a bomb defusing
Reply With Quote #29

Yup. Basically to fix that. I had all the code written down to detect if the bomb is visible to the player. Just wasn't able to stop the defusing.

I did have a easier way to detect if there was something in the way. I do remember that because it wasn't complex to detect if there was something in the way.

Last edited by Kigen; 09-24-2009 at 20:51.
Kigen is offline
Timiditas
Senior Member
Join Date: Apr 2009
Old 09-24-2009 , 21:14   Re: Stop a bomb defusing
Reply With Quote #30

Quote:
Originally Posted by Kigen View Post
I did have a easier way to detect if there was something in the way. I do remember that because it wasn't complex to detect if there was something in the way.
I hoped for an easier way because the problem with the method I posted is, that it only works in a 2D-fashion. If you look at the bomb from the side (given that it is on height of your eyes), the ray will go through and hit the world a mile away. So it only works if you are looking at it top down.
__________________

Timiditas is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode