 |
|
Veteran Member
|

05-23-2013
, 19:35
Re: Find player using find_ent_in_sphere
|
#7
|
Quote:
Originally Posted by ConnorMcLeod
Use find_sphere_class is far more efficient.
It's like using get_players instead of looping all possible players.
PHP Code:
HurtPlayersInUserSphere(id, Float:radius, damage, etc...)
{
new players[32], player, num = find_sphere_class(id, "player", radius, players, sizeof(players));
for(--num; num>=0; num--)
{
player = players[num];
if( player != id )
{
// hurt player
}
}
}
|
find_sphere_class is still looping all players and checking their origins right?
|
|
|
|