Raised This Month: $ Target: $400
 0% 

distance between players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-09-2022 , 01:30   Re: distance between players
Reply With Quote #2

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.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
 



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