09.04.2015, 11:37
Quote:
Get the ID with a loop (loop through MAX_VEHICLES, I think I saw you had that)
new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParams or w/e the function is. I finds the closest vehicle so yes you do have the ID |
Код:
native IsValidVehicle(vehicleid); CMD:carbreakin(playerid, params[]) { new engine, lights, alarm, doors, bonnet, boot, objective; new Float: vX, Float: vY, Float: vZ ; for(new i = 0; i != MAX_VEHICLES; i++) { if (!IsValidVehicle(i)) continue; GetVehiclePos(i, vX, vY, vZ); if(IsPlayerInRangeOfPoint(playerid, 5.0, vX, vY, vZ)) { SendClientMessage(playerid, COLOR_LIGHTRED, "You're near a car and the breakin bit needs adding"); break; } else { } } return 1; }