DjSoftero |
01-23-2018 02:33 |
Re: distance between 2 players
Quote:
Originally Posted by Saint Sinner
(Post 2573576)
i know that ... but i want a kode to detect this...can someine help?
|
you can do it in client_think, or create a separate entity, which does like 2 operations per second looping through all the players, to determine whether two players are near each other.
PHP Code:
new Players[32], count, Float:distance get_players(Players, count) for(new i; i<count-1; i++) for(new j=i+1; j<count; j++) { distance = entity_range(Players[i], Players[j]) if(distance <= 100) { //two entities are nearby
} }
at least that's what I understood.
|