Jump to content

[REL] Hydra bomb script


szlend

Recommended Posts

Yesterday i thought of a great idea, a bomb script for Hydra. Well today I've managed to script it so here it is. The bomb currently moves only on the Z axis and with constant speed but I'll fix that in the future. Feel free to use/improve the script. The bomb is dropped with the 'R' key by default.

To-do:

- Drop delay (To stop bomb spamming)

- Bomb acceleration

- Bomb XY movement

Screenshots:

mtascreen0010ny7.th.jpg mtascreen0011oj7.th.jpg mtascreen0013gb9.th.jpg

Download:

http://rapidshare.com/files/89299762/bomb.zip.html

Edited by Guest
Link to comment

Stig don't forget that I put a function in the script for the GTAMP.NET server that prevents players in aircraft from killing pedestrian players with rockets, not sure if that will appy to this script , but it may well.

( I am posting this msg here just incase that is the case which would mean szlend's script is fine and he doesnt need to test it again :) )

With my script though, the rockets are still visible to attacker and victim its just that they don't hurt, so if the bombs or explosions are not seen maybe more work is needed :(

damn nice idear though szlend, we'll be letting u know if its just clashing with my script or not . Plus good luck on getting movement on the other axes , that will be sweet

Link to comment
I got it to work by adding arguments "x, y, z, rz, ez" to the dropBomb function in the server-side script.

Also, awesome script. :P

Omg thanks, I can't believe i forgot that xD Will do some tests today and release the fixed script

Edit: fixed and tested. Works fine now :)

Link to comment
nice script! I made something similar for the baron for my upcoming gamemode and i also tried to add a velocity on the x and y axis to the projectile by getting the velocity of the vehicle but it didnt work for me... maybe you can make it work :D

you can change the velocity only for vehicles and players atm

Link to comment

omg thx norby i always forgot about the target argument because i thought with the other projectiles i dont have to define it so i never set it to nil... gonna test it right now =)

Great it works very well =)

Here's the code szlend:

       local usedVehicle = getPlayerOccupiedVehicle (getLocalPlayer()) 
    local x, y, z = getElementPosition(getLocalPlayer()) 
    local velx, vely, velz = getElementVelocity (usedVehicle) 
    createProjectile (getLocalPlayer(), 21, x, y, z - 0.1, 10, nil, 90, 0, 0, velx, vely, -0.1) 

For the Z Axis i think a higher value for the hydra is better i use this for bombing with a baron =)

Link to comment

Hehe it's nice but it glows too much and it's a bit small for my taste. I'll stick to my current object :) But using moveObject causes a lot of problems since I don't know how to detect when the object collides with the world when I set XY movement. Currently (with only Z axis movement) I use getGroundPosition so i know where to destroy the missile and create an explosion. Any ideas?

Link to comment

try something like this:

function checkHeight (bomb) 
    local x, y, z = getElementPosition (bomb) 
    z2 = getGroundPosition (x, y, z) 
    if z <= z2 + 10 then -- check the z points and becaus of the little delay triggering server events causes you have to set the point a bit higher than he actually is 
        z = z2 - 10 -- subsctract the 10 units to create the explosion at the right position and not 10 units above the ground 
        triggerServerEvent ( "createexplosion", getRootElement () , x, y, z) --trigger the event the function is attached to that creates the explosion and pass the arguments x, y, z 
        killTimer (timer) 
    else 
        -- nothing to do here  
    end 
end 
  
function dropbomb () 
    --in the function you create the bomb just add this 
    --bomb = the "bomb" object 
    timer = setTimer (checkHeight, 100, 0, bomb) 
end 

i havent tested it yet and i hope you understand what the functions are supposed to do^^

also you might have to mess a little bit around with the number that defines how many untis the checking point for the z axis is over the ground to prevent the explosion beeing created under the ground due to delay

I hope i have made it all right and could help you with that though it might look a bit confusing at first :lol:

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