intente con el destroy pero nada le mando el script y me podria ayudar a corregirlo?
function crear(player)
local account = getPlayerAccount(player)
local accname = getAccountName(account)
if( accname == "Juan_Camilo" ) then -- Ejemplo "Juan_Camilo" es el nombre de la cuenta que tiene permitido usar el comando.
local x, y, z = getElementPosition (player)
createVehicle (566, x, y + 5, z) -- 566 Es el ID del vehiculo.
end
end
addCommandHandler ("Auto", crear) -- lo de las comillas es el comando a utilizar.
----------------------------------------------------------------------------------------------------------
Vehicles = { [566]=true }
function destroyVehiclesOfModel(modelID)
-- get a table of all the vehicles that exist and loop through it
local vehicles = getElementsByType("vehicle")
for i,v in ipairs(vehicles) do
-- if the vehicle's ID is the one provided, destroy it
if (getElementModel(v) == modelID) then
destroyElement(v)
end
end
end
destroyVehiclesOfModel(566)