Jump to content

I need help (shooter)


Recommended Posts

It doesn't work and /debugscript 3 doesn't say nothing..

cLP = getLocalPlayer() 
  
function cdoshoot() 
    if bindTrigger == 1 then 
        if not isPlayerDead(cLP) then 
            bindTrigger = 0 
            local x,y,z = getElementPosition(theVehicle) 
            local rX,rY,rZ = getElementRotation(theVehicle) 
            local x = x+4*math.cos(math.rad(rZ+90)) 
            local y = y+4*math.sin(math.rad(rZ+90)) 
            createProjectile(theVehicle, 19, x, y, z, 1.0, nil) 
            setTimer(allowShoots, 4000, 1) 
                local theVehicle = getPedOccupiedVehicle(cLP) 
                    allowShoots() 
                    bindKey("fire", "down", cdoshoot) 
        end 
    end 
end 
  
function allowShoots() 
    bindTrigger = 1 
end 

PS: Is my script wrong? if it's can u say me what is wrong or gimme a shoot script

Link to comment
function cdoshoot() 
    local cLP = getLocalPlayer() 
    local theVehicle = getPedOccupiedVehicle(cLP) 
    if bindTrigger == 1 then 
        if not isPlayerDead(cLP) then 
            bindTrigger = 0 
            local x,y,z = getElementPosition(theVehicle) 
            local rX,rY,rZ = getElementRotation(theVehicle) 
            local x = x+4*math.cos(math.rad(rZ+90)) 
            local y = y+4*math.sin(math.rad(rZ+90)) 
            createProjectile(theVehicle, 19, x, y, z, 1.0, nil) 
            setTimer(allowShoots, 4000, 1) 
                    allowShoots() 
                    bindKey("fire", "down", cdoshoot) 
        end 
    end 
end 
  
function allowShoots() 
    bindTrigger = 1 
end 

Doesnt work, no debugscript 3.

Link to comment
function cdoshoot(theVehicle) 
    local theVehicle = getPedOccupiedVehicle(localPlayer) 
    if bindTrigger == 1 then 
        if not isPlayerDead(localPlayer) then 
            bindTrigger = 0 
            local x,y,z = getElementPosition(theVehicle) 
            local rX,rY,rZ = getElementRotation(theVehicle) 
            local x = x+4*math.cos(math.rad(rZ+90)) 
            local y = y+4*math.sin(math.rad(rZ+90)) 
            createProjectile(theVehicle, 19, x, y, z, 1.0, nil) 
            setTimer(allowShoots, 4000, 1) 
                    allowShoots() 
                    bindKey("fire", "down", cdoshoot) 
        end 
    end 
end 
  
function allowShoots() 
    bindTrigger = 1 
end 

Link to comment
function cbinds() 
    bindKey("vehicle_fire", "down", cdoshoot) 
    bindKey("vehicle_secondary_fire", "down", cdoshoot) 
    bindKey("lctrl", "down", cdoshoot) 
    bindKey("rctrl", "down", cdoshoot) 
    allowShoots() 
end 
addEventHandler("onClientResourceStart", getRootElement(), cbinds) 
  
  
function cdoshoot(theVehicle) 
    local theVehicle = getPedOccupiedVehicle(localPlayer) 
    if bindTrigger == 1 then 
        if not isPlayerDead(localPlayer) then 
            bindTrigger = 0 
            local x,y,z = getElementPosition(theVehicle) 
            local rX,rY,rZ = getElementRotation(theVehicle) 
            local x = x+4*math.cos(math.rad(rZ+90)) 
            local y = y+4*math.sin(math.rad(rZ+90)) 
            createProjectile(theVehicle, 19, x, y, z, 1.0, nil) 
            setTimer(allowShoots, 4000, 1) 
        end 
    end 
end 
  
function allowShoots() 
    bindTrigger = 1 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...