Thank you very much. Can you enable and disable this code as above?
g_P = getLocalPlayer()
rocketTimer = false
function rocket()
if not rocketTimer and isPedInVehicle(g_P) then
local occupiedVehicle = getPedOccupiedVehicle(g_P)
local rotX,rotY,rotZ = getElementRotation(occupiedVehicle)
local x, y, z = getElementPosition(occupiedVehicle)
local matrix = getElementMatrix(occupiedVehicle)
local offX = 0 * matrix[1][1] + 1 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1]
local offY = 0 * matrix[1][2] + 1 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2]
local offZ = 0 * matrix[1][3] + 1 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3]
local vx = offX - x
local vy = offY - y
local vz = offZ - z
x = 0 * matrix[1][1] + 3 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1]
y = 0 * matrix[1][2] + 3 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2]
z = 0 * matrix[1][3] + 3 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3]
createProjectile(g_P, 19, x, y, z, 200, nil, 0, 0, 360 - rotZ, vx, vy, vz)
rocketTimer = setTimer(function() rocketTimer = false end, 3000, 1)
else
outputChatBox("#ff00003 Sec Wait!", 0, 0, 0, true)
end
end
function onResourceStart()
bindKey("lctrl", "down", rocket)
end
addEventHandler("onClientResourceStart", resourceRoot, onResourceStart)