Eu estava tentando colocar esse spawn de vehiculo por acl, mas não estou conseguindo. Alguém consegue me ajudar?
veh = {}
addEventHandler("onResourceStart", resourceRoot, function()
for i, v in ipairs(spawn) do
local veh = createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
setElementCollisionsEnabled(veh, false)
setElementData(veh, "vehSpawn", true)
setElementFrozen(veh, true)
setVehicleDamageProof(veh, true)
end
end)
addEventHandler("onVehicleEnter", getRootElement(), function(player)
if source and getElementType(source) == "vehicle" then
local model = getElementModel(source)
local x, y, z = getElementPosition(source)
if getElementData(source, "vehSpawn") then
if veh[player] and isElement(veh[player]) then
destroyElement(veh[player])
end
veh[player] = createVehicle(model, x+3, y, z)
warpPedIntoVehicle(player, veh[player])
end
end
end)
addEventHandler("onPlayerWasted", root, function()
if veh[source] and isElement(veh[source]) then
destroyElement(veh[source])
end
end)
addEventHandler("onPlayerLogout", root, function()
if veh[source] and isElement(veh[source]) then
destroyElement(veh[source])
end
end)
addEventHandler("onPlayerQuit", root, function()
if veh[source] and isElement(veh[source]) then
destroyElement(veh[source])
end
end)