/rob closest player help
#2

You can use stock GetClosestPlayer(playerid);

Код:
stock GetClosestPlayer(playerid)
{
    new Float:dis,Float:dis2,player;
    player = -1;
    dis = 99999.99;
    foreach(Player,x)
    {
        if(x != playerid)
        {
            dis2 = GetDistanceBetweenPlayers(x,playerid);
            if(dis2 < dis && dis2 != -1.00)
            {
                dis = dis2;
                player = x;
            }
        }
    }
    return player;
}

CMD:rob(playerid, params[])
{
if(GetClosestPlayer(playerid) == -1) return SendClientMessage(ID, 0xFF0000AA, "ERROR : No player close to you!");
printf("Player with ID %i is closest to you!", GetClosestPlayer(playerid));
return 1;
}
Reply


Messages In This Thread
/rob closest player help - by AmirRFCNR - 29.08.2014, 15:30
Re: /rob closest player help - by Thogy - 29.08.2014, 15:42
Re: /rob closest player help - by BroZeus - 29.08.2014, 15:43
Re: /rob closest player help - by Stinged - 29.08.2014, 15:44
Re : /rob closest player help - by AmirRFCNR - 29.08.2014, 21:58
Re: /rob closest player help - by Noliax8 - 29.08.2014, 22:57
Re : /rob closest player help - by AmirRFCNR - 30.08.2014, 14:52
Re: /rob closest player help - by Lukka_Vercetti - 30.08.2014, 15:46
Re : Re: /rob closest player help - by AmirRFCNR - 30.08.2014, 16:23
Re: /rob closest player help - by Lukka_Vercetti - 30.08.2014, 16:29

Forum Jump:


Users browsing this thread: 1 Guest(s)