pls help me: GetClosestPlayers
#4

Try using IsPlayerInRangeOfPoint but make it in a loop.

I mean using for, such as:

pawn Код:
new string[125];
new Float:x;
new Float:y;
new Float:z;
SendClientMessage(playerid, #COLOR#, "Closest player (arranged from the nearest)");
for(new i=1; i < 11; i++)
{
for(new a = 0; a < MAX_PLAYERS; a++)
{
GetPlayerPos(a, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, i, x, y, z)) //x, y and z is the float of
{
format(string, sizeof(string), "ID: %i", a);
SendClientMessage(playerid, #COLOR#, string);
}
}
}
It will shows the closest players. But there still a little bug where that:
If a player range is 1 (Really close to you), SendClientmessage will say his/her ID for 10 times
If a player range is 2 (Close to you), SendClientMessage will say his/her ID for 9 times
......

Like that.

Hope helps
Reply


Messages In This Thread
pls help me: GetClosestPlayers - by DJ-CJ89 - 14.04.2010, 07:40
Re: pls help me: GetClosestPlayers - by RichyB - 14.04.2010, 07:54
Re: pls help me: GetClosestPlayers - by DJ-CJ89 - 14.04.2010, 08:45
Re: pls help me: GetClosestPlayers - by VirSpectorX - 14.04.2010, 08:59
Re: pls help me: GetClosestPlayers - by Thrarod - 14.04.2010, 09:04

Forum Jump:


Users browsing this thread: 1 Guest(s)