maskatchi Posted July 12, 2011 Share Posted July 12, 2011 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 so if anyone can help with creating an object to shoot missiles that be great Link to comment
Jaysds1 Posted July 12, 2011 Share Posted July 12, 2011 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
Aibo Posted July 12, 2011 Share Posted July 12, 2011 Jaysds1, please stop posting nonsense with syntax errors in almost every line. maskatchi, there's was a topic about projectiles just the other day. Link to comment
bandi94 Posted July 12, 2011 Share Posted July 12, 2011 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
qaisjp Posted July 12, 2011 Share Posted July 12, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now