Matevsz Posted December 20, 2015 Share Posted December 20, 2015 Hello, if can do so that the plane was flying around the city at a speed of 10km / h? in the middle with no player but can be ped? Link to comment
myonlake Posted December 20, 2015 Share Posted December 20, 2015 You need someone to stream it, obviously. Your server cannot stream pedestrians unless you craft your own rendering system server-side, which is quite heavy. And stupid. What I suggest is you simply disable streaming for a ped element and a vehicle element, and then just control the pedestrian while it's in air. I built a script for this a while ago and it works quite well, just need some math to keep the plane stable. Link to comment
Matevsz Posted December 21, 2015 Author Share Posted December 21, 2015 (edited) I wanted to do it with markers, unfortunately I can not loop so wrote out all the steps to moveObject but does not work airship = createVehicle(592, 1921.3000488281, -1735.1999511719, 158*272) markeryLS { a = createMarker(2185.8000488281, -1723.1999511719, 170, "ring", 1.5, 0, 0, 0, 0) b = createMarker(2620, -1764.8000488281, 170, "ring", 1.5, 0, 0, 0, 0) c = createMarker(2649.6999511719, -1188.1999511719, 170, "ring", 1.5, 0, 0, 0, 0) d = createMarker(1378.1999511719, -911.59997558594, 170, "ring", 1.5, 0, 0, 0, 0) e = createMarker(740, -1061.1999511719, 170, "ring", 1.5, 0, 0, 0, 0) f = createMarker(443.89999389648, -1608.4000244141, 170, "ring", 1.5, 0, 0, 0, 0) g = createMarker(1893, -1736.5, 170, "ring", 1.5, 0, 0, 0, 0) } addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 2185.8000488281, -1723.1999511719, 170) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 2620, -1764.8000488281, 170) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 2649.6999511719, -1188.1999511719, 170) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 1378.1999511719, -911.59997558594, 170) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 740, -1061.1999511719, 170) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 443.89999389648, -1608.4000244141, 170) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 1893, -1736.5, 170) end end end ) Edited December 21, 2015 by Guest Link to comment
myonlake Posted December 21, 2015 Share Posted December 21, 2015 If you want to do it like that, then you need to have an object, and then you use attachElements to attach the vehicle to the object. Then you move the object, and the vehicle will move with it. This is a pretty lame way of doing the movement, just saying. It doesn't look nice either. Link to comment
Matevsz Posted December 21, 2015 Author Share Posted December 21, 2015 (edited) Could you give an example of how would you can do it? local airship = createVehicle(592, 1921.3000488281, -1735.1999511719, 158*272) markeryLS { a = createMarker(2185.8000488281, -1723.1999511719, 170, "ring", 1.5, 0, 0, 0, 0) b = createMarker(2620, -1764.8000488281, 170, "ring", 1.5, 0, 0, 0, 0) c = createMarker(2649.6999511719, -1188.1999511719, 170, "ring", 1.5, 0, 0, 0, 0) d = createMarker(1378.1999511719, -911.59997558594, 170, "ring", 1.5, 0, 0, 0, 0) e = createMarker(740, -1061.1999511719, 170, "ring", 1.5, 0, 0, 0, 0) f = createMarker(443.89999389648, -1608.4000244141, 170, "ring", 1.5, 0, 0, 0, 0) g = createMarker(1893, -1736.5, 170, "ring", 1.5, 0, 0, 0, 0) } addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 2185.8000488281, -1723.1999511719, 170) attachElements(airship, a, 0, 0, 0) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 2620, -1764.8000488281, 170) attachElements(airship, b, 0, 0, 0) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 2649.6999511719, -1188.1999511719, 170) attachElements(airship, c, 0, 0, 0) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airshipc, 600000, 1378.1999511719, -911.59997558594, 170) attachElements(airship, d, 0, 0, 0) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 740, -1061.1999511719, 170) attachElements(airship, e, 0, 0, 0) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 443.89999389648, -1608.4000244141, 170) attachElements(airship, f, 0, 0, 0) end end end ) addEventHandler("onMarkerHit",markeryLS, function(vehicle) if getElementType(vehicle)=="vehicle" then if source == markeryLS then moveObject(airship, 600000, 1893, -1736.5, 170) attachElements(airship, g, 0, 0, 0) end end end ) Edited December 21, 2015 by Guest Link to comment
Captain Cody Posted December 21, 2015 Share Posted December 21, 2015 If you want the airplane to fly right, you can have it check the altitude every so often, if it gets to low aim it up, if it gets to high aim it down, stuff along the lines of that. btw put your code in [lua][./lua] brackets instead of [./code] Link to comment
Matevsz Posted December 21, 2015 Author Share Posted December 21, 2015 Yes, but can not see it in the game, and do not fly straight in debugscript nothing Link to comment
Captain Cody Posted December 21, 2015 Share Posted December 21, 2015 (edited) Lemme finnish up what I'm doing now and I'll write a script for it. -- Yeah nvm to much stuff to do -- Edited December 21, 2015 by Guest Link to comment
Matevsz Posted December 21, 2015 Author Share Posted December 21, 2015 Well I'll wait Link to comment
myonlake Posted December 21, 2015 Share Posted December 21, 2015 Well I'll wait Things like this are not "easy" to make. You need to stop asking us for scripts and learn to script yourself. Link to comment
Matevsz Posted December 21, 2015 Author Share Posted December 21, 2015 I know it is not easy, I learn lua but how can I learn if you do not know what is wrong? I removed * 272 with ruler createVehicle and createVehicle swapped for CreateObject because it's probably not going to hook moveObject under createVehicle Instead of the model aircraft (592) on the object model (1683), but does not work 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