Thread: No Clip - Stuck
View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-26-2009 , 13:56   Re: No Clip - Stuck
Reply With Quote #7

Quote:
Originally Posted by Scherzo View Post
User origin its not whole user entity.
If that's an issue you can use EngFunc_GetBonePosition and check the point-contents of various body parts.

PHP Code:
static FloatfOrigin] , FloatfDummy];
engfuncEngFunc_GetBonePosition id BONE_SPINE1 fOrigin fDummy ); 
Try this:

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

#define PLUGIN "Check if Stuck"
#define VERSION "1.0"
#define AUTHOR "bugsy"

/*
#define BONE_SPINE1    3  //Spine
#define BONE_SPINE2    4  //Spine
#define BONE_SPINE3    5  //Spine
#define BONE_SPINE4     6  //Spine
#define BONE_HEAD    8  //Head
#define BONE_L_UPPERARM    11 //Left UpperArm
#define BONE_L_HAND    13 //Left Hand
#define BONE_L_SHOULDER    23 //Left shoulder outside
#define BONE_L_KNEE    40 //Left knee
#define BONE_L_FOOT    41 //Left Foot
#define BONE_R_UPPERARM    26 //Right UpperArm
#define BONE_R_HAND    28 //Right Hand
#define BONE_R_SHOULDER    39 //Right shoulder outside
#define BONE_R_KNEE    46 //Left knee
#define BONE_R_FOOT    47 //Left Foot 
*/

new const g_Bones[] = { 11 13 23 40 41 26 28 39 46 47 };

public 
plugin_init() 
{
    
register_pluginPLUGIN VERSION AUTHOR );
    
register_clcmd"say /start" "DoStart" );
}

public 
DoStartid )
{
    
set_task0.5 "Stuck" id ,_"b" );
}

public 
Stuckid )
{
    static 
FloatfOrigin] , FloatfDummy];
    
    for ( new 
sizeof g_Bones i++ )
    {
            
engfunc(EngFunc_GetBonePositionid g_Bones] , fOrigin fDummy );
            
            if ( 
engfuncEngFunc_PointContents fOrigin ) == CONTENTS_SOLID )
            {
                
client_printid print_chat "Stuck in object" );
                return;
            }
    }
    
    
client_printid print_chat "Can move freely" );

__________________

Last edited by Bugsy; 07-26-2009 at 14:13.
Bugsy is offline