26.03.2018, 16:27
here i also tested it:
you can set you'r own radius too
you can set you'r own radius too
PHP код:
IsPlayerNearSpecificVehicle(playerid, vehicle_modelid, Float:radius)
{
new Float:vx, Float:vy, Float:vz;
for(new vi = 0; vi < MAX_VEHICLES; vi++)
{
GetVehiclePos(vi, vx, vy, vz);
if(vi == INVALID_VEHICLE_ID || GetVehicleModel(vi) != vehicle_modelid || !IsPlayerInRangeOfPoint(playerid, radius, vx, vy, vz)) continue;
return 1;
}
return 0;
}