stock GetClosestCar(playerid)
{
if (!IsPlayerConnected(playerid))
{
return -1;
}
new Float:prevdist = 100000.000;
new prevcar;
for (new carid = 0; carid < MAX_VEHICLES; carid++)
{
new Float:dist = GetDistanceToCar(playerid,carid);
if ((dist < prevdist))
{
prevdist = dist;
prevcar = carid;
}
}
return prevcar;
}
parancsba
new VehID = GetClosestCar(playerid);
new Float: vX, Float: vY, Float: vZ;
GetVehiclePos(VehID, vX, vY, vZ);
if(!IsPlayerInRangeOfPoint(playerid, 5.5, vX, vY, vZ))
így esetleg?