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

block forward and duck does not work (code)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
loki_himself
Member
Join Date: Nov 2021
Old 03-01-2022 , 14:36   block forward and duck does not work (code)
Reply With Quote #1

...

Last edited by loki_himself; 11-23-2022 at 12:20.
loki_himself is offline
AdrenalinesWrath
Junior Member
Join Date: Aug 2017
Old 03-01-2022 , 18:38   Re: block forward and duck does not work (code)
Reply With Quote #2

assuming you're hooking it with fakemeta. try this:

Code:
public On_ClientPreThink(id)
{
    if (!is_user_connected(id) )
        return FMRES_IGNORED
    
	new buttons = pev(id,pev_button);

    if(is_user_bot(id)) {
        if(buttons & IN_DUCK)
        {
            buttons &= ~IN_DUCK;
            set_pev(id, pev_button, buttons);
			return FMRES_SUPERCEDE;	
        }

        if(buttons & IN_FORWARD)
        {
            buttons &= ~IN_FORWARD;
            set_pev(id, pev_button, buttons);

            // new Float:vector1[3]
            // vector1[0] = 0.0
            // vector1[1] = 0.0
            // vector1[2] = 0.0
            // set_user_velocity(id,vector1)
			return FMRES_SUPERCEDE;
        }
    }
	return FMRES_IGNORED;
}
have to use fmres_supercede for that aswell
__________________
"True Strength's keeping everything together, while everyone expects you to fall apart."
AdrenalinesWrath is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-01-2022 , 23:01   Re: block forward and duck does not work (code)
Reply With Quote #3

Quote:
Originally Posted by AdrenalinesWrath View Post
assuming you're hooking it with fakemeta. try this:


have to use fmres_supercede for that aswell
No you shouldn't blocking player prethink is the wrong way to achieve what he wants, in matter of a fact it wont do nothing.

And this is a useless check.

PHP Code:
    if (!is_user_connected(id) )
        return 
FMRES_IGNORED 
If you want to properly block ducking you need to hook Orpheu that subject already been explained just search for it.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-03-2022 at 05:53.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
loki_himself
Member
Join Date: Nov 2021
Old 03-02-2022 , 10:11   Re: block forward and duck does not work (code)
Reply With Quote #4

...

Last edited by loki_himself; 11-23-2022 at 13:30.
loki_himself is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-02-2022 , 11:17   Re: block forward and duck does not work (code)
Reply With Quote #5

Quote:
Originally Posted by loki_himself View Post
doesnt work. and i dont want to use orpheu
Alright try setting aswell pev_oldbuttons

PHP Code:
set_pev(idpev_oldbuttonsbuttons); 
Is there any specific reason to not use Orpheu?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-02-2022 at 11:18.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
AdrenalinesWrath
Junior Member
Join Date: Aug 2017
Old 03-02-2022 , 15:46   Re: block forward and duck does not work (code)
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
No you shouldn't blocking player prethink is the wrong way to achieve what he wants, in mature of a fact it wont do nothing.
woops, my bad!
I meant if he hooked it with
Code:
register_forward(FM_CmdStart, "fw_CmdStart")
so it would look like this:

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


public plugin_init()
{
    
register_plugin("Block duck n forward""0.1""Wrath")
    
register_forwardFM_CmdStart "fm_CmdStart" );
}

public 
fm_CmdStart(id,Handle)
{
    new 
ButtonsButtons get_uc(Handle,UC_Buttons);
    
    if(
is_user_bot(id))
    {
        if(
buttons IN_FORWARD)
        {
            
Buttons &= ~IN_FORWARD;
        }
        else if(
buttons IN_DUCK)
        {
            
Buttons &= ~IN_DUCK;
            
        } else return 
FMRES_IGNORED;
        
        
set_ucHandle UC_Buttons Buttons );
        return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;

hope this does the trick
__________________
"True Strength's keeping everything together, while everyone expects you to fall apart."
AdrenalinesWrath is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-03-2022 , 06:45   Re: block forward and duck does not work (code)
Reply With Quote #7

You shouldn't supersede FM_CmdStart either.
__________________








CrazY. 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 15:28.


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