- A simple command who allow you to remove a near car.
-- > Server Side
-- > Server Side
Code:
local function DestroyNearCar(player) local xP, yP, zP = GetPlayerLocation(player) for k,v in pairs(GetAllVehicles()) do local xV, yV, zV = GetVehicleLocation(v) local dist = GetDistance3D(xP, yP, zP, xV, yV, zV) if dist < 300.0 then --Should be better DestroyVehicle(v) end end end AddCommand("del", DestroyNearCar)
Comment