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

Duck


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 12:40   Duck
Reply With Quote #1

Hello,

I search just one function that block a crouch.

Thanks ;)
__________________
sooN is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 07-03-2009 , 13:00   Re: Duck
Reply With Quote #2

this should work, don't forget register_plugin
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_forward(FM_CmdStart"fw_cmdstart_pre");
}

public 
fw_cmdstart_pre(iduc_handle)
{
    if(!
is_user_alive(id))
    {
        return 
FMRES_IGNORED;
    }

    static 
b;
    
get_uc(uc_handleUC_Buttons);

    if (
IN_DUCK)
    {
        
&= ~IN_DUCK;
        
set_uc(uc_handleUC_Buttonsb);
    }
    return 
FMRES_IGNORED;

TheRadiance is offline
Send a message via ICQ to TheRadiance
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-03-2009 , 13:05   Re: Duck
Reply With Quote #3

It won't work since it's something client-side. You have to use an alternative way, I think there are some posts about that.
__________________
Arkshine is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 13:15   Re: Duck
Reply With Quote #4

Thanks but this plugin don't run, when i crouch it's not blocked.
__________________

Last edited by sooN; 07-03-2009 at 13:17.
sooN is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 07-03-2009 , 13:25   Re: Duck
Reply With Quote #5

sorry.
arkshine said that it won't work via duck it's client-side feature.

but anyway, i hope my code is correct.
TheRadiance is offline
Send a message via ICQ to TheRadiance
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-03-2009 , 13:27   Re: Duck
Reply With Quote #6

Player speed is still decreased, but he can't duck.
La vitesse du joueur est toujours diminiuée mais il ne peut pas s'accroupir.

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

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("No Duck"VERSION"ConnorMcLeod")
    
RegisterHam(Ham_Player_Duck"player""Player_Duck")
}

public 
Player_Duckid )
{
//    set_pev(id, pev_button, pev(id, pev_button) & ~IN_DUCK)
    
set_pev(idpev_oldbuttonspev(idpev_oldbuttons) | IN_DUCK)


Quote:
Originally Posted by TheRadiance View Post
sorry.
arkshine said that it won't work via duck it's client-side feature.

but anyway, i hope my code is correct.
It's not really that, players movements are not done from CmdStart.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-03-2009 at 14:49.
ConnorMcLeod is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 14:02   Re: Duck
Reply With Quote #7

Tranks Connor now it's okay ^^
__________________
sooN is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-03-2009 , 14:49   Re: Duck
Reply With Quote #8

Updated, only oldbuttons is needed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
TheVaskov
Member
Join Date: Sep 2021
Location: Russia
Old 11-22-2022 , 12:24   Re: Duck
Reply With Quote #9

Why it didn't work in Day Of Defeat today ? Please help . I'm searching how to block crouch\duck and jump
__________________
TheVaskov is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 11-22-2022 , 14:28   Re: Duck
Reply With Quote #10

the fact that this topic is almost 14 years old make me believe he really searched before creating a new one! xd

-> https://forums.alliedmods.net/showthread.php?t=66500
__________________
a simple act of caring creates an endless ripple.
Nutu_ 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:44.


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