20 lines
868 B
Lua
20 lines
868 B
Lua
--------------------------------------
|
|
------Created By Whit3Xlightning------
|
|
--https://github.com/Whit3XLightning--
|
|
--------------------------------------
|
|
|
|
RegisterNetEvent("wld:delallveh")
|
|
AddEventHandler("wld:delallveh", function ()
|
|
local totalvehc = 0
|
|
local notdelvehc = 0
|
|
|
|
for vehicle in EnumerateVehicles() do
|
|
if (not IsPedAPlayer(GetPedInVehicleSeat(vehicle, -1))) then SetVehicleHasBeenOwnedByPlayer(vehicle, false) SetEntityAsMissionEntity(vehicle, false, false) DeleteVehicle(vehicle)
|
|
if (DoesEntityExist(vehicle)) then DeleteVehicle(vehicle) end
|
|
if (DoesEntityExist(vehicle)) then notdelvehc = notdelvehc + 1 end
|
|
end
|
|
totalvehc = totalvehc + 1
|
|
end
|
|
local vehfrac = totalvehc - notdelvehc .. " / " .. totalvehc
|
|
Citizen.Trace("You just deleted "..vehfrac.." vehicles in the server!")
|
|
end) |