Jump to content

Launching heat-seeking rockets from area 69


Recommended Posts

Hello all,

I have a server and the errors keep coming with my new script. Right now I try a script where it should fire a heat seeking rocket at you in a 50.0 sphere from 354.43, 2028.49, 25.4141 if you are 30.0 in z-coords. When that is true it should fire a heat-seeking rocket on you (like happens in single player if you are flying above area 69).

Right now I have a script. I made a colSphere with a radius of 50.0, I check if the player is in the colSpher. If it is true it should throw a heat seeking rocket at the player. Sad enough it doesn't work. The isn't created a projectile (at least I didn't regocnize it), and if it did wasn't fired on the player's vehicle (an airplane or helicopter in most cases). Does anyone know what the problem is in this script? The whole script is client-sided.

    function join() 
       local Rzone1 = createColSphere(354.43, 2028.49, 22.4141, 50.0) 
    end 
    addEventHandler( "onClientResourceStart", getRootElement( ), join) 
  
    function boem() 
       local target = getPedOccupiedVehicle(player) 
       local bom = createProjectile(getLocalPlayer(), 20, 354.43, 2028.49, 25.4141, 1.0, target) 
    end 
  
    function boemRadius(player, a) 
       local x,y,z = getElementPosition(player) 
       if (z >= 30) then 
          if (boem_first) then 
             setTimer(boem, 3000, 1) 
          else 
             local target = getPedOccupiedVehicle(player) 
             local bom = createProjectile(player, 20, 354.43, 2028.49, 25.4141, 1.0, target, 0, 0, 0, 0, 0, 0) 
             local boem_first = 1 
          end 
       end 
    end 
    addEventHandler("onColShapeHit", Rzone1, boemRadius) 

Link to comment
  • Moderators
local Rzone1 = createColSphere(354.43, 2028.49, 22.4141, 100.0) 
function boemRadius(player, a) 
    local x,y,z = getElementPosition(player) 
    if (z >= 30) then 
        local target = getPedOccupiedVehicle(player) 
        local bom = createProjectile(player, 20, 354.43, 2028.49, 25.4141, 1.0, target ) 
        setTimer( boemRadius, 4000, 1, player ) 
    end 
 end 
addEventHandler("onClientColShapeHit", Rzone1, boemRadius) 

Works ( tested )

Link to comment
  • 3 months later...

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