local vehicles = { }
addEvent("spawnvehicle", true)
addEventHandler("spawnvehicle", root,
function(vehID)
local team = getPlayerTeam(source)
if (team and getTeamName(team) == "Medic") then
if isElement(vehicles[source]) then destroyElement(vehicles[source]) end
vehicles[source] = createVehicle(vehID, getElementPosition(source))
if (vehicles[source]) then
setVehicleColor(vehicles[source], 255, 255, 255)
setTimer(warpPedIntoVehicle, 200, 1, source, vehicles[source])
triggerClientEvent(source, "closeWindow", root)
end
end
end)