Raised This Month: $ Target: $400
 0% 

[ H3LP ] Check player stuck


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-21-2017 , 05:58   Re: [ H3LP ] Check player stuck
Reply With Quote #9

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 ; }
__________________

Last edited by edon1337; 06-21-2017 at 06:00.
edon1337 is offline
 



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 22:46.


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