Raised This Month: $ Target: $400
 0% 

[ H3LP ] Check player stuck


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-20-2017 , 15:09   [ H3LP ] Check player stuck
Reply With Quote #1

Hello. How can I check if a player is stuck inside another player? I made a check but it is only for if the player stuck on ground etc. Any help would be appreciated. need this to finish the unstuck plug-in. Thanks !

Last edited by DarthMan; 06-20-2017 at 15:18.
DarthMan is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 06-20-2017 , 18:39   Re: [ H3LP ] Check player stuck
Reply With Quote #2

What's wrong with Ramono's Plugin?
__________________
gabuch2 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-21-2017 , 03:37   Re: [ H3LP ] Check player stuck
Reply With Quote #3

Quote:
Originally Posted by Gabe Iggy View Post
What's wrong with Ramono's Plugin?
It checks only if the player is stuck inside walls or in teh ground, not inside a player.
DarthMan is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 06-21-2017 , 06:16   Re: [ H3LP ] Check player stuck
Reply With Quote #4

Quote:
Originally Posted by DarthMan View Post
It checks only if the player is stuck inside walls or in teh ground, not inside a player.
it definitely should work with players.
jimaway is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-21-2017 , 05:19   Re: [ H3LP ] Check player stuck
Reply With Quote #5

Loop through all players and check if they have same origin?
__________________
edon1337 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-21-2017 , 05:28   Re: [ H3LP ] Check player stuck
Reply With Quote #6

Quote:
Originally Posted by edon1337 View Post
Loop through all players and check if they have same origin?
It won't work that way, cuz wut if the players have a different origin but they're still stuck, not in center? Like if a player is stuck in another player's head it would have an origin, if it is stuck in center of him another origin etc so it won't work that way.
DarthMan is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-21-2017 , 05:36   Re: [ H3LP ] Check player stuck
Reply With Quote #7

Yeah, what about checking if they have close origins ?
__________________
edon1337 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-21-2017 , 05:41   Re: [ H3LP ] Check player stuck
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
Yeah, what about checking if they have close origins ?
Ik how to check for same origin, just pev both origins of the players using pev then if origin of player a equals origin of player b, but how can I check for closer origins? Btw I am using a modified version of Arkshine's unstick plug-in, since I'm not the best at advanced calculations, but I modified it a bit and also made a stock that uses trace hull.
DarthMan is offline
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
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-21-2017 , 06:26   Re: [ H3LP ] Check player stuck
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
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 ; }
Thanks, will check it out
DarthMan 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 22:46.


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