Raised This Month: $51 Target: $400
 12% 

How to detect when player standing on uneven surface?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 12-25-2012 , 16:35   How to detect when player standing on uneven surface?
Reply With Quote #1

Hello.
Is there a way to detect if player standing on uneven surface like a ramp on de_nuke or ramp on de_dust2 on long?
In attachment its example of this places marked as "red X".
Is it possible?

Thanks for any help.
Attached Thumbnails
Click image for larger version

Name:	ramp_de_nuke.jpg
Views:	173
Size:	59.0 KB
ID:	113654  

Last edited by hh2; 12-27-2012 at 09:16.
hh2 is offline
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 12-27-2012 , 09:11   Re: How to detect when player standing on uneven surface?
Reply With Quote #2

Bump.
hh2 is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-27-2012 , 10:44   Re: How to detect when player standing on uneven surface?
Reply With Quote #3

don't bump until at least 2 weeks have passed since last post

this should work in most cases (it may fail if player is standing on the edge):
PHP Code:
public function(id){
    new 
trFloat:start[3], Float:dest[3]
    
pev(idpev_originstart)
    
dest[0] = start[0]
    
dest[1] = start[1]
    
dest[2] = start[2] - 100.0
    engfunc
(EngFunc_TraceLinestartdestIGNORE_MONSTERSidtr)
    
get_tr2(trTR_vecPlaneNormaldest)
    if(
xs_vec_dot(Float:{0.0,0.0,1.0}, dest) != 1.0){
        
//uneven surface
    
}

__________________
Impossible is Nothing
Sylwester is offline
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 12-27-2012 , 11:50   Re: How to detect when player standing on uneven surface?
Reply With Quote #4

Works correctly.
Thanks for help Sylwester.
hh2 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 01:54.


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