15.03.2014, 16:51
(
Последний раз редактировалось BroZeus; 17.03.2014 в 11:39.
)
CPTP:ClosestPlayerToPoint(x,y,z)
So this is a very simple and a samll include but very usefulWhat it does?
It returns the id of closet player to a point.
Usage
Its usage is like this--
pawn Код:
ClosestPlayerToPoint(x,y,z)
You will need foreach.inc for its use.
Code
A very short code so i will not provide any link and here is the code--
pawn Код:
/*This include is by Zeus and whole credit goes to him*/
/*===================DO Not Remove This credit========*/
#include <a_samp>
#include <foreach>
stock ClosestPlayerToPoint(Float:x,Float:y,Float:z)
{
new Float:clos=20000.0,m,Float:distance,id;
foreach(m:Player)
{
distance=GetPlayerDistanceFromPoint(m,x,y,z);
if(distance < clos)
{
id=m;
clos=distance;
}
}
return id;
}