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

Get coordinates of ground


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 01-27-2016 , 18:13   Get coordinates of ground
Reply With Quote #1

Hello,

rest in pic.



Thanks in advance.
ESK0 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 01-27-2016 , 18:31   Re: Get coordinates of ground
Reply With Quote #2

Tracerays :F
Miu is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 01-27-2016 , 18:37   Re: Get coordinates of ground
Reply With Quote #3

Quote:
Originally Posted by Miu View Post
Tracerays :F
I thought about that.

Can you give me some example ? Please ?
ESK0 is offline
th7nder
Senior Member
Join Date: Oct 2014
Old 01-27-2016 , 18:55   Re: Get coordinates of ground
Reply With Quote #4

Code:
public bool GetClientGroundPosition(int iClient, float fGround[3]){
	float fOrigin[3];
	GetClientAbsOrigin(iClient, fOrigin);
	
	float fAngles[3] = {90.0, 0.0, 0.0};
	TR_TraceRayFilter(fOrigin, fAngles, MASK_SOLID, RayType_Infinite, TraceRay_DontHitSelf, iClient);
	if(TR_DidHit()){
		TR_GetEndPosition(fGround);
		return true;
	}
	
	return false;
}

public bool TraceRay_DontHitSelf (int iTarget, iMask, int iClient) { return (iTarget != iClient); }
th7nder is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 01-27-2016 , 19:10   Re: Get coordinates of ground
Reply With Quote #5

Quote:
Originally Posted by th7nder View Post
Code:
public bool GetClientGroundPosition(int iClient, float fGround[3]){
	float fOrigin[3];
	GetClientAbsOrigin(iClient, fOrigin);
	
	float fAngles[3] = {90.0, 0.0, 0.0};
	TR_TraceRayFilter(fOrigin, fAngles, MASK_SOLID, RayType_Infinite, TraceRay_DontHitSelf, iClient);
	if(TR_DidHit()){
		TR_GetEndPosition(fGround);
		return true;
	}
	
	return false;
}

public bool TraceRay_DontHitSelf (int iTarget, iMask, int iClient) { return (iTarget != iClient); }
Oh, thank you so much. LoL i searched something hard.. And its simple )
ESK0 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 20:06.


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