[Release] Heli Script

Isn’t that ESX? not FX

FX server, esx framework

So in other words you don’t need ESX framework to have this work because someone told me that this is ESX only?

No you do not. I have nothing ESX in my local server it works great!

@mraes and @LoirdKillmore I added on your code a bit by adding the heading (courtesy also to streetLabel)

function RenderVehicleInfo(vehicle)
if DoesEntityExist(vehicle) then
local model = GetEntityModel(vehicle)
local vehname = GetLabelText(GetDisplayNameFromVehicleModel(model))
local licenseplate = GetVehicleNumberPlateText(vehicle)

  -- Location of target vehicle 
  local x,y,z = table.unpack(GetEntityCoords(vehicle, false))
    local streetName, crossing = GetStreetNameAtCoord(x, y, z)
    streetName = GetStreetNameFromHashKey(streetName)
    local location = ""
  		if crossing ~= 0 then
  			crossing = GetStreetNameFromHashKey(crossing)
  			location = streetName .. ", " .. crossing 
  		else
  	location = streetName 
  end

  -- Heading of target vehicle
  	local directions = { [0] = 'North', [45] = 'North-West', [90] = 'West', [135] = 'South-West', [180] = 'South', [225] = 'South-East', [270] = 'East', [315] = 'North-East', [360] = 'North', }
  for k,v in pairs(directions)do
  	direction = GetEntityHeading(vehicle, false)
  	if(math.abs(direction - k) < 22.5)then
  		direction = v
  		break;
  	end
  end		
  
  if speed_measure == "MPH" then
  	vehspeed = GetEntitySpeed(vehicle)*2.236936
  else
  	vehspeed = GetEntitySpeed(vehicle)*3.6
  end
  SetTextFont(0)
  SetTextProportional(1)
  if vehicle_display == 0 then
  	SetTextScale(0.0, 0.40)
  elseif vehicle_display == 1 then
  	SetTextScale(0.0, 0.40)
  end
  SetTextColour(255, 255, 255, 255)
  SetTextDropshadow(0, 0, 0, 0, 255)
  SetTextEdge(1, 0, 0, 0, 255)
  SetTextDropShadow()
  SetTextOutline()
  SetTextEntry("STRING")
  if vehicle_display == 0 then
  	AddTextComponentString("Speed: " .. math.ceil(vehspeed) .. " " .. speed_measure .. "\nModel: " .. vehname .. "\nPlate: " .. licenseplate)
  elseif vehicle_display == 1 then
  	AddTextComponentString("Heading: " .. direction .. "\nLocation: " .. location .. "\nSpeed: " .. math.ceil(vehspeed) .. "\nModel: " .. vehname .. "\nPlate: " .. licenseplate)
  end
  DrawText(0.45, 0.8)

end
end

@HumanTree92

This is the complete function, including the text display. Just substitute it in heli_client.lua (lina 576 onwards for me). If you want to edit what is displayed how, edit the AddTextComponentString lines accordingly. The text size is above that in SetTextScale(0, 0.X). Just edit the X to make it smaller or larger.

good job, yeah thats pretty much how i added heading and stuff aswell in the end . Took me a while to also optimize controls for keyboard and gamepad and all that stuff xD but its a cool script .

I added the code of Torch and nothing happen (StreetName)
The text has just disappeared ?

Someone got the same problem ? You got a solution ?

Is there anyway to make the sound for changing the brightness and size not server sided because everyone on the server hears it when I activate the camera.

Hey, can you send me the heli_client.lua file? When I try to add the code you sent me it just fucks it up.

Are you sure you’re activating the tracking when in the chopper? (Q) it’s a toggle with three options

Anyone have an issue with the resource not loading? Those of you running an FX Server, are you simply adding a ‘start heli’ entry in your server config? It appears from the logs, that the server doesnt have an issue loading the resource but the client side always gives me the error ‘Couldn’t load resource heli’ and won’t allow me to load into the server.

Works fine for me. Must be something on your end.

Are you using the modified script and starting it with a ‘start heli’ entry in your server?

Yes I was and It did not cause any issues for me.

Would you mind sending me your files for the heli script?

is there a way to move the spotlight?

Camera spotlight normal function
Plus the players can not see the light like when using front camera (G)
It would have to leave her like front camera so that others can see the light

Anyway i can add new helis to the script? say i wanted to add the valkyrie helicopter since thats a Seaking replaced there.

how to get this to sync with all players for the spot light?

1 Like

Is it possible to change the name? I own a Alaska server and would love to change the watermark/name.
https://gyazo.com/e224aa801224c3b043abcb83cab03741