Below is a simple code that allows all vehicles to fire missiles. How can we adjust this to make only 1 vehicle (Infernus: id 411) fire missiles.
local shootTimer = nil
function shoot()
local vehicle = getPedOccupiedVehicle(localPlayer)
if not isElement(vehicle) then return end
if(not isTimer(shootTimer))then
local posX, posY, posZ = getElementPosition(vehicle)
shootTimer = setTimer(function()end, 5000, 1)
createProjectile(vehicle, 19, posX, posY, posZ, 1.0)
end
end
bindKey("vehicle_fire", "down", shoot)
bindKey("vehicle_secondary_fire", "down", shoot)