29.10.2012, 06:12
Hey eric, Stu has gone to bed... so i'll post our stock on his behalf.
Код:
stock GetClosestVehiclePolice(playerid) { #pragma unused playerid new Float:x, Float:y, Float:z; new Float:dist, Float:closedist=50, closeveh; for(new i=1; i < MAX_VEHICLES; i++) { if(GetVehiclePos(i, x, y, z)) { dist = GetPlayerDistanceFromPoint(playerid, x, y, z); if(dist < closedist) { closedist = dist; closeveh = i; } } } return closeveh; }