Jump to content

Script issue - my fault, or MTA?


OffRoader23

Recommended Posts

Ok, so everything SEEMS to be scripted right in my script. It's a simple script that shoots a rocket out of your car when you shoot. I've modified it to be able to shoot grenades and stuff, but I will just post the basic code.

  
function fireRocket(cmd) 
    local vehicle = getPlayerOccupiedVehicle(getLocalPlayer()) 
    local driver = getVehicleOccupant ( vehicle, 0 ) 
    if (driver == getLocalPlayer()) then 
        local sX, sY, sZ = getElementPosition ( vehicle ) 
        createProjectile ( getLocalPlayer(), 19, sX, sY, sZ + 3, 1.0 ) 
    end 
end 
addCommandHandler("supersecretcommandthatnoonewilleverfigureout", fireRocket) 

It works great... until you have a passenger. Then it won't stop shooting until they get out. The rockets originate from where your car was sitting when you first fired the rocket and you had the passenger in, so if you drive away, they still shoot FROM where you were sitting before. Is this my script or MTA? Because from what I can see, it seems to be scripted correctly. I tried it without the driver checks, etc. and it still fails. Any help/comments would be appreciated.

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