Jump to content

can someone please help? :D


Recommended Posts

yeah umm Ive been trying to make a script to creatProjectile and stuff, i read the wiki read some posts. nobody has really explained well on how to create a projectile and attach to your car to shoot at people etc :P so if anyone can help with creating an object to shoot missiles that be great :lol:

Link to comment

Where not allowed to give you scripts, ur suppose to create it and if you have problems, ask us, but I'll allow it this time...

Try this:

  
function attach(button) 
local vehicle = getPedOccupiedVehicle(getLocalPlayer) 
    if (vehicle) then 
if (button == "left" then 
createProjectile(vehicle,19,vehicle+2,vehicle+2,vehicle+2,) --This creates the projectile at the side of the vehicle 
end 
end 
  

Link to comment
  
g_P = getLocalPlayer() 
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) 
end 
end 
bindKey( "num_sub", "up", rocket ) 
  

tested and working you shoot whit numpad - you can change it on bindkey

Link to comment
  Jaysds1 said:
Where not allowed to give you scripts, ur suppose to create it and if you have problems, ask us, but I'll allow it this time...

I know this is offtopic and may sound like back-seat modding but Jay, there are no rules saying "we are not allowed to give you scripts". There is a big difference between trying to help someone and giving an entire script.

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