ESA_PIRAO Posted March 1, 2006 Posted March 1, 2006 Hi,... I made for our squad a utility to make an automatic log of some parameters of the flights we make. It uses export.lua script to export data from flights. Really it makes a file with some parameters and then the pilot send to our website this file and another script in php interprets it and update the logbook of the pilot putting the procesed data in the database. The problem (i don't know if that's a bug) started with 1.2 patch. Before with 1.1 it worked good. I explain the problem we have... All the lua functions work good but one (or two I don't know exactly) doesn't work. Concretly LoGetObjectById() now give NULL values when you ask for own flight. In the script i take, at the start of the mission, with this function the name of the flight (like MiG-29S (Me)(Pilot1) ) anf after i take from that the model of the plane. Also I take Lat, Long and alt. The same when the mission stop. But now it doesn't work. The export script is the same but now all this data have NULL values. I use this two lines. av = LoGetPlayerPlaneId() prop = LoGetObjectById(av) So i have the matrix prop to work with it (prop.Name, prop.LatLongAlt) I don't know really what of this two functions doesn't work good. LoGetPlayerPlaneId() returns a number like always but I don't know if this number is correct one because when I pass this to the LoGetObjectById() function all is NULL Anyone more note this problem? Anyone knows whats the matter with the function? I think that must be a bug, because i read the new export and somethings are changed (for example the now you can use LUA coroutines) but this two functions are the same than before. ??? Is really a bug? Must I change something? Please help me, i need this data to continue working with our automatic pilot logbook. If anyone use this functions too, now does it work with the 1.12, 1.12a? Help me please,.., i'm desesperate, i can't find a solution myself. Thank to all in advance.. ESA_PIRAO www.cruzdesanandres.com ESA_PIRAO www.cruzdesanandres.com
Pat01 Posted March 1, 2006 Posted March 1, 2006 Have a look at Lock On\Config\export\config.lua -> You have to enable EnableExportScript for each client and server I think. --[[ Export.lua script is always local , but if EnableExportScript = false you cannot access to cheat posible functions : LoGetWorldObjects and LoGetObjectByID this functions always will return nil to enable them just set EnableExportScript = true --]] EnableExportScript = true --
ESA_PIRAO Posted March 1, 2006 Author Posted March 1, 2006 It works,... Thank you very much Pat01... I've readen it in the new export.lua sample, but i didn't understand it. Because the other data worked, i thought that was a function problem. Like you can read my english is not so good,... :P So that's no a LOMAC BUG is MY BUG :P Thanks again Pat01 you make me happy.... :) ESA_PIRAO www.cruzdesanandres.com
Recommended Posts