Jump to content

2 hydra models


Swimer

Recommended Posts

How do I create a new model, and give it the properties of a hydra. Or is there another way? I have several models that replace the hydra. I tried to replace other models of air vehicles with them, but when spawning some, the game immediately crashes, some explode on spawn due to their height and then crash, and some crash when the plane crashes into an obstacle (explosion). I don’t care about the physics of other aircraft, so can I somehow simply transfer the properties of the hydra to other aircraft models?

Link to comment
function ShamalWeapons()
   if not s then
      s = true
      bindKey("lctrl", "down", ShamalProjectiles)
   else
      s = false
      unbindKey("lctrl", "down", ShamalProjectiles)
   end
end
addCommandHandler("tweap", ShamalWeapons)

local projectiles = {}
local antispam = {}

function ShamalProjectiles()
   local vehicle = getPedOccupiedVehicle(localPlayer)
   if vehicle then
      if getElementModel(vehicle) == 519 then
         if not antispam[localPlayer] or antispam[localPlayer] + 500 <= getTickCount() then
            antispam[localPlayer] = getTickCount()
            local px, py, pz = getElementPosition(vehicle)
            local rx, ry, rz = getElementRotation(vehicle)
            projectiles[1] = createProjectile(vehicle, 19, px+2, py, pz-2, 3)
            projectiles[2] = createProjectile(vehicle, 19, px-2, py, pz-2, 3)
         else
            cancelEvent()
         end
      end
   end
end

You will need to do something like this and if I'm not wrong you will need to use trigger event in a server-side script for the rockets to be visible for everyone. 

NOTE: this script will work only if you are using shamal aircraft

Edited by Hydra
Link to comment
19 minutes ago, Hydra said:
function ShamalWeapons()
   if not s then
      s = true
      bindKey("lctrl", "down", ShamalProjectiles)
   else
      s = false
      unbindKey("lctrl", "down", ShamalProjectiles)
   end
end
addCommandHandler("tweap", ShamalWeapons)

local projectiles = {}
local antispam = {}

function ShamalProjectiles()
   local vehicle = getPedOccupiedVehicle(localPlayer)
   if vehicle then
      if getElementModel(vehicle) == 519 then
         if not antispam[localPlayer] or antispam[localPlayer] + 500 <= getTickCount() then
            antispam[localPlayer] = getTickCount()
            local px, py, pz = getElementPosition(vehicle)
            local rx, ry, rz = getElementRotation(vehicle)
            projectiles[1] = createProjectile(vehicle, 19, px+2, py, pz-2, 3)
            projectiles[2] = createProjectile(vehicle, 19, px-2, py, pz-2, 3)
         else
            cancelEvent()
         end
      end
   end
end

You will need to do something like this and if I'm not wrong you will need to use trigger event in a server-side script for the rockets to be visible for everyone. 

NOTE: this script will work only if you are using shamal aircraft

With weapons, everything is clear, with a crash question. I can assume that the hydra can change the flight mode (horizontal, vertical) and the models are designed for this. Or the game is trying to get aircraft parts that are not in the hydra model (or vice versa).

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