``````````````local w,h = guiGetScreenSize()
local jumping = false
local rocket1 = true
local rocket2 = true
local time_reload = 2000
local time_jump = 2000
local height = 0.27
function shoot1()
if isPedInVehicle(localPlayer) and not isCursorShowing() and rocket1 == true then
local veh = getPedOccupiedVehicle(localPlayer)
local x,y,z = getElementPosition(veh)
createProjectile(veh, 19, x,y,z)
rocket1 = false
tick1 = getTickCount()
end
end
bindKey("mouse1", "down", shoot1)
function shoot2()
if isPedInVehicle(localPlayer) and not isCursorShowing() and rocket2 == true then
local veh = getPedOccupiedVehicle(localPlayer)
local x,y,z = getElementPosition(veh)
createProjectile(veh, 19, x,y,z)
rocket2 = false
tick2 = getTickCount()
end
end
bindKey("mouse2", "down", shoot2)
function jump()
if isPedInVehicle(localPlayer) and isPedOnGround(localPlayer) and jumping == false then
local veh = getPedOccupiedVehicle(localPlayer)
local vx,vy,vz = getElementVelocity(veh)
setElementVelocity(veh,vx,vy,vz + height)
jumping = true
setTimer ( function()
jumping = false
end, time_jump, 1 )
end
end
bindKey("lshift", "down", jump)
function reload1()
if isPedInVehicle(localPlayer) then
if rocket1 == false then
local veh = getPedOccupiedVehicle(localPlayer)
local currentTick = getTickCount()
local time = currentTick - tick1
if time < time_reload then
local procent = time / time_reload * 100
local height = 100 / 100 * procent
dxDrawRectangle ( w/100*2, h-120, 30,100, tocolor( 0,0,0, 155 ) )
dxDrawRectangle ( w/100*2, h-20-height, 30,height, tocolor( 200,0,0, 255 ) )
else
rocket1 = true
end
else
dxDrawRectangle ( w/100*2, h-120, 30,100, tocolor( 0,0,0, 155 ), true )
dxDrawRectangle ( w/100*2, h-120, 30,100, tocolor( 200,0,0, 255 ), true )
end
end
end
addEventHandler("onClientRender", root, reload1)
function reload2()
if isPedInVehicle(localPlayer) then
if rocket2 == false then
local veh = getPedOccupiedVehicle(localPlayer)
local currentTick = getTickCount()
local time = currentTick - tick2
if time < time_reload then
local procent = time / time_reload * 100
local height = 100 / 100 * procent
dxDrawRectangle ( w/100*98-30, h-120, 30,100, tocolor( 0,0,0, 155 ) )
dxDrawRectangle ( w/100*98-30, h-20-height, 30,height, tocolor( 200,0,0, 255 ) )
else
rocket2 = true
end
else
dxDrawRectangle ( w/100*98-30, h-120, 30,100, tocolor( 0,0,0, 155 ), true )
dxDrawRectangle ( w/100*98-30, h-120, 30,100, tocolor( 200,0,0, 255 ), true )
end
end
end
addEventHandler("onClientRender", root, reload2)
Beyler böyle birşey buldum fakat tüm araçlar ateş ediyor bunu startlayınca ben bunu kısıtlamak istiyorum yardımcı olurmusunuz