Raised This Month: $51 Target: $400
 12% 

trying to resolve bot defuse bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LukeyB
Member
Join Date: Dec 2011
Old 02-10-2012 , 08:39   trying to resolve bot defuse bug
Reply With Quote #1

sometimes when a bot starts defusing, they will look up and press the use button again to cancel the defuse and will keep doing this until the bomb explodes. I am trying to block them from moving their crosshair and pressing the use key when they are defusing. It doesn't seem to be working. They can still move their crosshair when defusing.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
new g_max
public plugin_init()
{
register_plugin("bombdefusing""1.0""LB")
register_event("BarTime""event_defusing""be""1=5""1=10")
g_max get_maxplayers()
}
public 
event_defusing(iduc_handle)
{
new 
buttons get_uc(uc_handle,UC_Buttons)
for ( new 
id=1id<=g_maxid++ )
{
if ( 
is_user_alive(id) && is_user_bot(id) && buttons IN_USE)
{
buttons &= ~IN_USE
buttons 
&= ~IN_RELOAD
set_uc
(uc_handle,UC_Buttons,buttons)
static 
Float:angles[3]
pev(idpev_v_angleangles);
angles[0]=0.0
set_pev
(idpev_anglesangles);
set_pev(id,pev_fixangle,1)
}
}


Last edited by LukeyB; 02-10-2012 at 12:02.
LukeyB is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-10-2012 , 13:30  
Reply With Quote #2

I didnt look at the actual code but the event im pretry sure is only called one time at defuse start
Doc-Holiday is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-10-2012 , 13:57   Re: trying to resolve bot defuse bug
Reply With Quote #3

I'm not sure the best way to go about resolving the bug. Maybe when they press IN_USE, stop them from standing up or moving crosshair.

they seem to press in_use before they crouch then crouch and start defusing then stand up and let go of in_use which stops defusing then do it over and over...really annoying. I am sure it's resolvable, but just not sure where to start now.

Anyone have an idea?

Last edited by LukeyB; 02-10-2012 at 13:59.
LukeyB is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-10-2012 , 14:38   Re: trying to resolve bot defuse bug
Reply With Quote #4

Try this :

With http://forums.alliedmods.net/showpos...28&postcount=2

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"
#define PLUGIN "Bot Defuse Fix"

const IsDefusing = (1<<8)
#define is_user_defusing(%0)    ( get_pdata_int(%0,232,5) & IsDefusing )

new HamHook:g_iHhPlayerPostThinkHamHook:g_iHhBotPlayerPostThink
new g_iDefuser
new Float:g_flVecAngles[3]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_event("TextMsg""Event_TxtMsg_Defusing""be""1=4""2&#Defusing_Bomb_With")
    
DisableHamForward
    
(
        
g_iHhPlayerPostThink RegisterHam(Ham_Player_PostThink"player""CBasePlayer_PostThink"false)
    )
}

public 
cz_bot_ham_registerableid )
{
    
DisableHamForward
    
(
        
g_iHhBotPlayerPostThink RegisterHam(Ham_Player_PostThink"player""CBasePlayer_PostThink"false)
    )
}

public 
Event_TxtMsg_Defusingid )
{
    if( !
is_user_bot(id) )
    {
        return
    }
    
g_iDefuser id
    pev
(idpev_v_angleg_flVecAngles)
    
SetForwardstrue )
}

public 
CBasePlayer_PostThinkid )
{
    if( !
g_iDefuser )
    {
        
SetForwardsfalse )
        return 
HAM_IGNORED
    
}
    if( 
id == g_iDefuser )
    {
        if( !
is_user_defusing(id) )
        {
            
g_iDefuser 0
            SetForwards
false )
            return 
HAM_IGNORED
        
}
        static 
buttons buttons pev(idpev_button)
        if( 
buttons IN_RELOAD )
        {
            
set_pev(idpev_buttonbuttons & ~IN_RELOAD)
        }
        
set_pev(idpev_anglesg_flVecAngles)
        
set_pev(idpev_fixangle1)
        return 
HAM_HANDLED
    
}
    return 
HAM_IGNORED
}

SetForwardsbool:bOnOff )
{
    if( 
bOnOff )
    {
        if( 
g_iHhPlayerPostThink )
        {
            
EnableHamForwardg_iHhPlayerPostThink )
        }
        if( 
g_iHhBotPlayerPostThink )
        {
            
EnableHamForwardg_iHhBotPlayerPostThink )
        }
    }
    else
    {
        if( 
g_iHhPlayerPostThink )
        {
            
DisableHamForwardg_iHhPlayerPostThink )
        }
        if( 
g_iHhBotPlayerPostThink )
        {
            
DisableHamForwardg_iHhBotPlayerPostThink )
        }
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-10-2012 , 14:56   Re: trying to resolve bot defuse bug
Reply With Quote #5

Thanks, but it doesn't work. They still stand up when crouched and cancel defusing.
LukeyB is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-10-2012 , 16:17   Re: trying to resolve bot defuse bug
Reply With Quote #6

Quote:
Originally Posted by LukeyB View Post
sometimes when a bot starts defusing, they will look up and press the use button again to cancel the defuse and will keep doing this until the bomb explodes. I am trying to block them from moving their crosshair and pressing the use key when they are defusing. It doesn't seem to be working. They can still move their crosshair when defusing.
...
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-10-2012 , 16:23   Re: trying to resolve bot defuse bug
Reply With Quote #7

Quote:
Originally Posted by LukeyB View Post
I'm not sure the best way to go about resolving the bug. Maybe when they press IN_USE, stop them from standing up or moving crosshair.

they seem to press in_use before they crouch then crouch and start defusing then stand up and let go of in_use which stops defusing then do it over and over...really annoying. I am sure it's resolvable, but just not sure where to start now.

Anyone have an idea?
...this explains it better. it's not just moving the crosshair causing the bug as was able to get them not to move their crosshair and they still stand up and stop defusing.
LukeyB is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-12-2012 , 00:58   Re: trying to resolve bot defuse bug
Reply With Quote #8

Is there a way to just stop the bot from standing up when defusing? Hoping this will fix bug.
Forcing them to hold down use key may also work.

Last edited by LukeyB; 02-12-2012 at 01:28.
LukeyB is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-12-2012 , 03:19   Re: trying to resolve bot defuse bug
Reply With Quote #9

video of bug: http://www.dailymotion.com/video/x59...-cz_videogames
LukeyB is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-20-2012 , 09:34   Re: trying to resolve bot defuse bug
Reply With Quote #10

Resolved with Orpheu...

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <orpheu>
#include <orpheu_advanced>
#include <orpheu_memory>
public plugin_init()
{        
    
OrpheuRegisterHook(OrpheuGetFunction("PM_Duck"),"OnPM_Duck")
}
public 
OrpheuHookReturn:OnPM_Duck()
{
    new 
OrpheuStruct:ppmove get_ppmove()
    new 
id OrpheuGetStructMember(ppmove,"player_index") + 1
    
if(is_user_alive(id) && is_user_bot(id) && pev(idpev_button) & IN_USE)
    {
        return 
OrpheuSupercede
    
}
    return 
OrpheuIgnored
}
OrpheuStruct:get_ppmove()
{        
    return 
OrpheuGetStructFromAddress(OrpheuStructPlayerMove,OrpheuMemoryGet("ppmove"))

LukeyB 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 04:35.


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