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

If I understand correctly ... the easiest way would be to check point-contents of the players origin when the no-clip expires.

Here's a little demo; add noclip onto yourself and then say /start in chat and then move in and out of boxes, walls, underground, and high in the sky outside of the maps upper boundary.

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

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

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

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

public 
Stuckid )
{
    static 
FloatfOrigin];
    
pevid pev_origin fOrigin );
    
    if ( 
engfuncEngFunc_PointContents fOrigin ) == CONTENTS_SOLID )
        
client_printid print_chat "Stuck in object" );
    else
        
client_printid print_chat "Can move freely" );

__________________

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