Detect Player is near to another player
Hi,
Is there a way to do this: Player A is near to Player B > Do somethink Player A is no longer near to Player B > Do somethink |
Re: Detect Player is near to another player
You could do a multidimensional array:
bool plyNearAnother[MAXPLAYERS+1][MAXPLAYERS+1]; Then OnPlayerRunCmd store the m_vecOrigin of the client then loop through the rest of the clients and compare the positions together using GetVectorDistance to get their distance. If plyNearAnother[client][other] == true && distance > MaxDistance: // Player left the distance of the other. If plyNearAnother[client][other] == false && distance <= MaxDistance: // Player is now close to the other player. |
Re: Detect Player is near to another player
Quote:
|
Re: Detect Player is near to another player
Maybe but i saw that you are banned then...
I wasn't working on that project xD |
Re: Detect Player is near to another player
Quote:
|
Re: Detect Player is near to another player
Quote:
|
Re: Detect Player is near to another player
GetVectorDistance' third parameter is ``squared``, if you set it to false, you'll need to square the number that you are comparing against (just once tho). This effectively cuts the number of square roots calculated to 0. That's exactly what I said on the previous post.
|
Re: Detect Player is near to another player
Quote:
|
All times are GMT -4. The time now is 11:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.