Raised This Month: $ Target: $400
 0% 

How do you force people to duck


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 05-14-2009 , 17:25   Re: How do you force people to duck
Reply With Quote #9

EDIT: While reading through this thread I forgot the main topic was how to force them to duck, not how to block duck ;D!

Using CmdStart won't work because jumping/ducking is handled client side.

The best solution I've come across is to trick the server into thinking you are already jumping/ducking. The only problem with this is the client will start to do the jump/duck on their screen until the server tells the client they are not (so the player will start their jump/duck but won't get far). Other players will not see the jumping/ducking player doing the jump/duck however.

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
RegisterHam(Ham_Player_PreThink"player""fwd_Player_PreThink");
}

public 
fwd_Player_PreThink(iClient)
    
set_pev(iClientpev_oldbuttonspev(iClientpev_oldbuttons)|IN_JUMP|IN_DUCK); 

Last edited by hlstriker; 05-14-2009 at 18:13.
hlstriker is offline
 



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 01:30.


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