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

Force player to Duck


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-08-2010 , 07:08   Re: Force player to Duck
Reply With Quote #11

Doesn't work for me, it just prevent player from duck (and jump...) but duck speed still applied when holding duck.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-08-2010 at 07:14.
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 01-08-2010 , 07:18   Re: Force player to Duck
Reply With Quote #12

for my works perfect

PHP Code:
#include amxmodx

#include hamsandwich
#include fakemeta

public plugin_init()
{
    
RegisterHamHam_Player_PreThink"player""prethink" )
}
 
public 
prethink(id)
{
    if( !
is_user_aliveid ) )
        return;

    
set_pevidpev_oldbuttonspevidpev_oldbuttons ) | IN_JUMP )
    
client_cmdid"+duck" )

dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-08-2010 , 12:56   Re: Force player to Duck
Reply With Quote #13

client_cmd needs to be sent to client and to come back to server, so it's a poor way, also it can be turned off by client.
+ view and size are still not correct
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 01-08-2010 , 13:17   Re: Force player to Duck
Reply With Quote #14

Quote:
Originally Posted by ConnorMcLeod View Post
also it can be turned off by client.
Not really, because the -duck command is "stopped" by
PHP Code:
set_pevidpev_oldbuttonspevidpev_oldbuttons ) | IN_JUMP 
I now, my method is not good.
dFF is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 08-09-2016 , 20:43   Re: Force player to Duck
Reply With Quote #15

Quote:
Originally Posted by ConnorMcLeod View Post
If you want to force a player to duck, so you can teleport him to a saved place safully, you can use this :

PHP Code:
new const Float:VEC_DUCK_HULL_MIN[3]    = {-16.0, -16.0, -18.0 }
new const 
Float:VEC_DUCK_HULL_MAX[3]    = { 16.0,  16.0,  18.0 
PHP Code:
    entity_set_int(idEV_INT_flagsentity_get_int(idEV_INT_flags) | FL_DUCKING)
    
engfunc(EngFunc_SetSizeidVEC_DUCK_HULL_MINVEC_DUCK_HULL_MAX)
    
engfunc(EngFunc_SetOriginidflOrigin
Else, i suggest to set pev_buttons in client_PreThink :

set_pev(id, pev_buttons, pev(id_pev_buttons) | IN_DUCK)
Sorry for bumping this after 6 years but I need to correct this for you.

The mins and maxs for a ducking player are:

Code:
-16.0, -16.0, -25.0 16.0, 16.0, 25.0

...since a player model's entity size while crouching is:

Code:
32.0, 32.0, 50.0



For a standing player, the mins and maxs should be:

Code:
-16.0, -16.0, -36.0 16.0, 16.0, 36.0

...since a player model's entity size while standing is:

Code:
32.0, 32.0, 72.0
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 08-10-2016 , 03:00   Re: Force player to Duck
Reply With Quote #16

Quote:
Originally Posted by georgik57 View Post
sorry for bumping this after 6 years but i need to correct this for you.

The mins and maxs for a ducking player are:


Code:
-16.0, -16.0, -25.0</p><p>16.0, 16.0, 25.0



...since a player model's entity size while crouching is:


Code:
32.0, 32.0, 50.0





for a standing player, the mins and maxs should be:


Code:
-16.0, -16.0, -36.0</p><p>16.0, 16.0, 36.0



...since a player model's entity size while standing is:


Code:
32.0, 32.0, 72.0
-16 -16 -18
16 16 32
Leech_v2 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 08-10-2016 , 10:37   Re: Force player to Duck
Reply With Quote #17

Quote:
Originally Posted by Leech_v2 View Post
-16 -16 -18
16 16 32
Quote:
Originally Posted by D7TestEntities.amxx.log
L 08/10/2016 - 176:49: [client_PreThink] iID: 1. Standing. Mins: -16.000000, -16.000000, -36.000000. Maxs: 16.000000, 16.000000, 36.000000.
L 08/10/2016 - 176:51: [client_PreThink] iID: 1. Crouching. Mins: -16.000000, -16.000000, -18.000000. Maxs: 16.000000, 16.000000, 32.000000.
You are right. Thank you.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
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:29.


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