19.04.2017, 14:30
Quote:
Код HTML:
GetClosestVehicle(playerid, Float:range) { new Float:POS[3]; if(GetPlayerPos(playerid, POS[0], POS[1], POS[2])) // check is player valid + get player pos { new Float:distance, cveh; for(new v; v < MAX_VEHICLES; v++) { if(!IsValidVehicle(v)) return INVALID_VEHICLE_ID; distance = GetVehicleDistanceFromPoint(v, POS[0], POS[1], POS[2]); if(distance <= range) cveh = v; } return cveh; } return false; // smthng wrong } |
Console: