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

Fix not being able to stop ducking after planting c4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 04-29-2022 , 06:56   Fix not being able to stop ducking after planting c4
Reply With Quote #1

As the title says i have this plugin:

HTML Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "CS:GO Crouch when planting"
#define VERSION "1.0"
#define AUTHOR "***SeKaC***"

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("BarTime", "BarTime_EventHandler", "be", "1=3");
    register_event("BarTime", "BarTime_EventHandler2", "b", "1=0");
    register_logevent("BarTime_EventHandler2", 3, "2=Planted_The_Bomb");
}

public BarTime_EventHandler(id) {
    if(!is_user_connected(id)) return;
    set_pev(id, pev_button, pev(id, pev_button) & IN_DUCK ); 
    client_cmd(id, "+duck") 
}

public BarTime_EventHandler2(id) {
    if(!is_user_connected(id)) return;
    set_pev(id, pev_button, pev(id, pev_button) & IN_DUCK );  
    client_cmd(id, "-duck") 
}

public client_disconnected(id) client_cmd(id, "-duck");  

return plugin_handler

Only problem is, after planting the bomb, the player will remain ducking forever

can somebody help with this?
Ark_Procession is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 04-29-2022 , 08:24   Re: Fix not being able to stop ducking after planting c4
Reply With Quote #2

~IN_DUCK
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 04-29-2022 , 12:42   Re: Fix not being able to stop ducking after planting c4
Reply With Quote #3

Quote:
Originally Posted by raizo11 View Post
~IN_DUCK
could you be more specific please?
Ark_Procession is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-29-2022 , 15:02   Re: Fix not being able to stop ducking after planting c4
Reply With Quote #4

~IN_DUCK instead of IN_DUCK in BarTime_EventHandler2().

PS - the last line of code does not belong there at all.
__________________

Last edited by OciXCrom; 04-29-2022 at 15:02.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 04-29-2022 , 17:36   Re: Fix not being able to stop ducking after planting c4
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
~IN_DUCK instead of IN_DUCK in BarTime_EventHandler2().

PS - the last line of code does not belong there at all.
oh thanks, did not work anyway.
Ark_Procession is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 04-29-2022 , 17:54   Re: Fix not being able to stop ducking after planting c4
Reply With Quote #6

The original thread posted this code:

HTML Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("BarTime", "PLANTING", "be", "1=3")
    register_logevent("PLANTED", 3, "2=Planted_The_Bomb")
    register_event("BarTime", "INTERRUPTED", "b", "1=0")
}

public PLANTING( id ) 
{
    client_cmd(id,"+duck");
}

public PLANTED( ) 
{
    new id = get_loguser_index() 
    
    client_cmd(id,"-duck");
}

public INTERRUPTED( id ) 
{
    if(get_user_team(id) == 1)
    {
        client_cmd(id,"-duck");
    }
}

stock get_loguser_index()
{
    new loguser[80], name[32]
    read_logargv(0, loguser, 79)
    parse_loguser(loguser, name, 31)
    
    return get_user_index(name) 
}

Only problem seems to be that when you interrumpt the planting, you stand up, and i understand that is undesirable.

If you can fix it , great otherwise i just live with that little nuisance
Ark_Procession is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-06-2022 , 23:04   Re: Fix not being able to stop ducking after planting c4
Reply With Quote #7

Simple anti-duck code without slow hacking:

PHP Code:
public plugin_init( )
{
    
register_forward(FM_CmdStart"fw_CmdStart");
}

public 
fw_CmdStart(id)
{
    if( 
pevidpev_button ) & IN_DUCK )
    {
        
set_pevidpev_bInDuck0.0 );
    }

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 05-06-2022 at 23:06.
Supremache 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:56.


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