I'm not good at calculations either but I hope this can lead you somewhere lol. Basically I'm hooking Ham_Touch and checking if Touched player's origin minus Toucher player's origin is less or equal to 10 (that should be enough to confirm they're stuck). I'm not sure which dimension of array I should check though..
Code:
#include < amxmodx >
#include < hamsandwich >
#include < engine >
#define MIN_DISTANCE 10.0
public plugin_init( ) {
RegisterHam( Ham_Touch, "player", "fw_HamTouchPost", 1 ) ;
}
public fw_HamTouchPost( iTouched, iToucher ) {
new Float:iTouchedOrigin[ 3 ], Float:iToucherOrigin[ 3 ] ;
entity_get_vector( iTouched, EV_VEC_origin, iTouchedOrigin ) ;
entity_get_vector( iTouched, EV_VEC_origin, iToucherOrigin ) ;
if( floatabs ( ( iTouchedOrigin[ 1 ] - iToucherOrigin[ 1 ] ) ) <= MIN_DISTANCE ) {
// stuck
}
return HAM_IGNORED ;
}
__________________