Raised This Month: $ Target: $400
 0% 

distance between players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-09-2022 , 01:34   Re: distance between players
Reply With Quote #1

Quote:
Originally Posted by EFFx View Post
If you are interested, here's this native you've used inside engine.cpp:

Code:
static cell AMX_NATIVE_CALL entity_range(AMX *amx, cell *params)
{
	int idxa = params[1];
	int idxb = params[2];

	CHECK_ENTITY(idxa);
	CHECK_ENTITY(idxb);

	edict_t *pEntA = TypeConversion.id_to_edict(idxa);
	edict_t *pEntB = TypeConversion.id_to_edict(idxb);

	REAL fRet = (pEntA->v.origin - pEntB->v.origin).Length();

	return amx_ftoc(fRet);
}
Basically it does the same as the first option you used, but definitely faster.
Thanks! very usefull!, how can i check it for get vector and get_distance_f ? by the way i think entity_range is better than take 2 vectors and use get_distance_f, right?, i need it faster and light, cause i will check it constantly

Last edited by MrPickles; 08-09-2022 at 01:37.
MrPickles 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 15:34.


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