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

make a bind


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mammapappa
Member
Join Date: Nov 2008
Old 07-16-2015 , 13:53   make a bind
Reply With Quote #1

hi can someone help me make a bind for this, that allows the player to bind a key to "+dd" and make the same function as this does when you press duck?

PHP Code:
#include <sourcemod>
#include <sdktools>

#define DOUBLEDUCK_HEIGHT 40.0

public Action OnPlayerRunCmdint clientint &buttons )
{
    if ( !
IsPlayerAliveclient ) ) return Plugin_Continue;
    
    static 
int fFlags;
    
fFlags GetEntityFlagsclient );
    
    if ( 
fFlags FL_ONGROUND )
    {
        if ( 
GetEntPropclientProp_Data"m_bDucking" ))
        {
            
float vecPos[3];
            
GetClientAbsOriginclientvecPos );
            
vecPos[2] += DOUBLEDUCK_HEIGHT
            
            if ( 
IsValidPlayerPosclientvecPos ) )
            {
                
TeleportEntityclientvecPosNULL_VECTORNULL_VECTOR );
            }
        }

    }
    
    return 
Plugin_Continue;
}

public 
bool IsValidPlayerPosint clientfloat vecPos[3] )
{
    static const 
float vecMins[] = { -20.0, -20.00.0 };
    static const 
float vecMaxs[] = { 20.020.072.0 };
    
    
TR_TraceHullFiltervecPosvecPosvecMinsvecMaxsMASK_SOLIDTraceFilter_IgnorePlayerclient );
    
    return ( !
TR_DidHitnull ) );
}

public 
bool TraceFilter_IgnorePlayerint entint maskany ignore_me )
{
    return ( 
ent != ignore_me );

mammapappa 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 12:15.


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