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

Point between two players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 09-29-2013 , 10:24   Point between two players
Reply With Quote #1

How to get the point between two players which is the same distance away from both players?

Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
Old 09-29-2013, 11:08
bibu
This message has been deleted by bibu. Reason: nvm
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-29-2013 , 11:10   Re: Point between two players
Reply With Quote #2

There may be a better way. If so, someone will point it out.

Code:
GetPointBetweenOrigins(Float:Origin1[3], Float:Origin2[3], Float:PointBetween[3]) {     PointBetween[0] = floatmin(Origin1[0], Origin2[0]) + floatabs(Origin1[0] - Origin2[0]) / 2.0;     PointBetween[1] = floatmin(Origin1[1], Origin2[1]) + floatabs(Origin1[1] - Origin2[1]) / 2.0;     PointBetween[2] = floatmin(Origin1[2], Origin2[2]) + floatabs(Origin1[2] - Origin2[2]) / 2.0; } GetPointBetweenPlayers(Player1, Player2, Float:PointBetween[3]) {     new Float:Origin1[3], Float: Origin2[3]; #if defined _engine_included     entity_get_vector(Player1, EV_VEC_origin, Origin1);     entity_get_vector(Player2, EV_VEC_origin, Origin2); #else     pev(Player1, pev_origin, Origin1);     pev(Player2, pev_origin, Origin2); #endif     PointBetween[0] = floatmin(Origin1[0], Origin2[0]) + floatabs(Origin1[0] - Origin2[0]) / 2.0;     PointBetween[1] = floatmin(Origin1[1], Origin2[1]) + floatabs(Origin1[1] - Origin2[1]) / 2.0;     PointBetween[2] = floatmin(Origin1[2], Origin2[2]) + floatabs(Origin1[2] - Origin2[2]) / 2.0; }
__________________

Last edited by Black Rose; 09-29-2013 at 11:11.
Black Rose 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 07:15.


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