14.04.2010, 08:59
Try using IsPlayerInRangeOfPoint but make it in a loop.
I mean using for, such as:
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
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);
}
}
}
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