Raised This Month: $32 Target: $400
 8% 

Force player to Duck


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 10-31-2009 , 18:54   Force player to Duck
Reply With Quote #1

I've tried with EV_INT_bInDuck, but doesn't work well:

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

new bool:induck[33]

public 
plugin_init() 
{
    
register_plugin("Force Duck""0.1""meTaLiCroSS")
    
    
register_clcmd("say /forceduck""cmdDuck")
}

public 
cmdDuck(id)
{
    if(
is_user_alive(id))
        
induck[id] = !induck[id]
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id) && induck[id])
        
entity_set_int(idEV_INT_bInDuck1)

Someone can help me?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 10-31-2009 , 22:12   Re: Force player to Duck
Reply With Quote #2

Don't know about what you need but:

PHP Code:
induck[id] = !induck[id
Is this correct?

Also, really don't know if am correct but, maybe:

Code:
#include <amxmodx> #include <engine> new bool:induck[33] public plugin_init() {     register_plugin("Force Duck", "0.1", "meTaLiCroSS")         register_clcmd("say /forceduck", "cmdDuck") } public cmdDuck(id) {     if(is_user_alive(id) )     {         if(!induck[id])         {             client_print(id, print_chat, "Duck enabled")             induck[id] = true         }         else         {             client_print(id, print_chat, "Duck disabled")             induck[id] = false         }     } } public client_PreThink(id) {     if(is_user_alive(id) && induck[id])         entity_set_int(id, EV_INT_bInDuck, 1) }
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 10-31-2009 , 22:17   Re: Force player to Duck
Reply With Quote #3

Yes, that is correct.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 11-01-2009 , 01:51   Re: Force player to Duck
Reply With Quote #4

pev_flags
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2009 , 05:33   Re: Force player to Duck
Reply With Quote #5

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)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-08-2010 , 00:02   Re: Force player to Duck
Reply With Quote #6

How do I force a player to duck and stay ducked?

Using button|IN_DUCK in PreThink doesn't work.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 01-08-2010 , 00:21   Re: Force player to Duck
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
How do I force a player to duck and stay ducked?

Using button|IN_DUCK in PreThink doesn't work.
And what about to do that in UpdateClientData using cd_handle?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 01-08-2010 , 00:21   Re: Force player to Duck
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
How do I force a player to duck and stay ducked?

Using button|IN_DUCK in PreThink doesn't work.
Try this

PHP Code:
public plugin_init()
{
    
register_plugin("Fuck""Fuck""Fuck")
    
RegisterHam(Ham_Player_PreThink"player""prethink");
}
 
public 
prethink(id)
    
set_pev(idpev_oldbuttonspev(idpev_oldbuttons)|IN_JUMP|IN_DUCK
01101101 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-08-2010 , 00:45   Re: Force player to Duck
Reply With Quote #9

I think you have to hook PM_Move with orpheu, you can't have any access to pmove vars without that module.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 01-08-2010 , 01:18   Re: Force player to Duck
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
I think you have to hook PM_Move with orpheu, you can't have any access to pmove vars without that module.
Actually with my code it works
01101101 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 20:31.


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