Raised This Month: $ Target: $400
 0% 

Block Duck on rotating entitys


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
uxMal
Member
Join Date: Oct 2007
Old 10-20-2009 , 17:24   Block Duck on rotating entitys
Reply With Quote #1

hey,

i don't want players to duck on entitys like func_rotating, func_door_rotating..

i wrote some code which already works but it just blocks your duck if your on the entity, if you jump and duck in jump and land on the entity in duck you won't stand up but still ducking...

i tried set_pev(id, pev_bInDuck, 0) or client_cmd(id,"-duck") but you can still duck on these entitys if you duck before in air...

heres my code

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


#define PLUGIN "Deathrun_Anti-Duck-Bug"
#define VERSION "1.0"
#define AUTHOR "ulmax"



//--------------------------------------------------------------------------------------------------

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_PlayerPreThink,"fwThink");
}
//--------------------------------------------------------------------------------------------------
public fwThink(id) {
    
    
    
    if(
is_user_alive(id) && (pev(id,pev_button) & IN_DUCK)) {
        
        if(
pev(id,pev_groundentity) > 32) {
            new 
cname[32];
            
pev(pev(id,pev_groundentity),pev_classname,cname,31);
            
            if(
containi(cname,"rotating") > 0) {
                
set_pev(idpev_oldbuttonspev(idpev_oldbuttons) | IN_DUCK)
                                                        
            }
        }
    }
    
}
//-------------------------------------------------------------------------------------------------- 
uxMal is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-20-2009 , 17:27   Re: Block Duck on rotating entitys
Reply With Quote #2

Try setting pev_buttons with a removed IN_DUCK flag. You could also try hooking FM_CmdStart.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
uxMal
Member
Join Date: Oct 2007
Old 10-20-2009 , 17:41   Re: Block Duck on rotating entitys
Reply With Quote #3

I've already tried setting pev_button with | IN_DUCK but it didn't work

hooking CmdStart ?
there must be a cleaner way...
the player just has to get up
uxMal is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-20-2009 , 19:07   Re: Block Duck on rotating entitys
Reply With Quote #4

would it not be better to hook FM_Touch and check if its a "rotating"
__________________
minimiller is offline
Send a message via MSN to minimiller
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-20-2009 , 19:32   Re: Block Duck on rotating entitys
Reply With Quote #5

Quote:
Originally Posted by minimiller View Post
would it not be better to hook FM_Touch and check if its a "rotating"
I don't think you understand the problem.

Try hooking Ham_Player_Duck and setting pev_oldbuttons in that. I don't know if that will work, but if not, try setting pev_buttons in that forward too.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-21-2009 , 01:11   Re: Block Duck on rotating entitys
Reply With Quote #6

Quote:
Originally Posted by Hawk552 View Post
I don't think you understand the problem.

Try hooking Ham_Player_Duck and setting pev_oldbuttons in that. I don't know if that will work, but if not, try setting pev_buttons in that forward too.
I think problem is that pev vars are not same as pmove vars, also you can't hook PM_Duck.
If your server is on linux you could try orpheu module and try to call PM_Unduck.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 10-21-2009 , 06:15   Re: Block Duck on rotating entitys
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
If your server is on linux you could try orpheu module and try to call PM_Unduck.
//

Quote:
Originally Posted by Hawk552 View Post
Try hooking Ham_Player_Duck and setting pev_oldbuttons in that.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

public plugin_init( )
{
    
RegisterHamHam_Player_Duck"player""FwdPlayerDuck" );
}

public 
FwdPlayerDuckiClient )
{
    new 
szClass32 ];
    
pevpeviClientpev_groundentity ), pev_classnameszClass31 );
    
    if( 
equalszClass"func_rotating" ) )
    {
        
set_peviClientpev_oldbuttonspeviClientpev_oldbuttons ) | IN_DUCK );

        
// client_cmd( iClient, "wait;-duck" );
    
}


Last edited by Jon; 10-21-2009 at 09:30.
Jon is offline
Old 10-21-2009, 06:26
uxMal
This message has been deleted by uxMal.
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-21-2009 , 05:48   Re: Block Duck on rotating entitys
Reply With Quote #9

Quote:
Originally Posted by Hawk552 View Post
I don't think you understand the problem.
My understanding is that he dosent want people to duck on rotating stuff
So i thought it would be easier to hook touch, check if its a rotating and do a client_cmd(id, "wait;-duck") or some shit
__________________
minimiller is offline
Send a message via MSN to minimiller
uxMal
Member
Join Date: Oct 2007
Old 10-21-2009 , 04:57   Re: Block Duck on rotating entitys
Reply With Quote #10

Hmmm just a quick idea , i can't test anything now

how about doaing a traceline to the bottom in PreThink so i can get when the player is in air just above the func_rotating (pev_groundentity only changes when you touch the ent first)
and you force the player to unduck in the air? aka setting bInDuck or sending -duck, buttons and stop all duck commands from then on
uxMal 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 17:37.


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