Jump to content

[HELP] Camera rocket script!


AlvarO

Recommended Posts

Hello guys, yesterday i was creating a script, a car who launch rockets, but i got a question...

How can I put for that when you launch a rocket (for example a grenade) it goes for where you are looking with the screen? I dont know if I explained good because my english is a pretty shit.

There you have the code:

function shootProjectile() 
    local vehicle = getPedOccupiedVehicle(localPlayer) 
    if(vehicle)then 
        local x, y, z = getElementPosition(vehicle) 
        createProjectile(vehicle, 19, x, y, z) 
        else 
        outputChatBox("No estas dentro de un vehiculo",255, 0, 0) 
    end 
end 
bindKey("k", "down", shootProjectile) 

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...