Deltanic Posted May 25, 2011 Share Posted May 25, 2011 pVeh = getPedOccupiedVehicle ( localPlayer ) vehLog = {} if not vehLog[pVeh] then logX, logY = guiGetPosition ( logPane, false ) lodW, logH = guiGetSize ( logPane, false ) vehLog[pVeh] = guiCreateScrollPane ( logX, logY, logW, logH, false, mainWnd.window ) guiSetVisible ( vehLog[pVeh], false ) end -- logPane is a VALID gui scrollpane, with mainWnd.window as parent. -- mainWnd.window is a VALID gui-window ofcourse. No errors yet. Remember that pVeh is global, it's not getting changed until I get another vehicle. Whenever I use vehLog[pVeh], it will return false/nil. Making pVeh a string doesnt solve anything. So, whatthefack is going on here? Second time I'm trying to implement a vehicle-based log now in hedit, and it still won't work goddamnit. Link to comment
qaisjp Posted May 25, 2011 Share Posted May 25, 2011 outputDebugString("start") pVeh = getPedOccupiedVehicle ( localPlayer ) vehLog = {} outputDebugString("if start") if not vehLog[pVeh] then logX, logY = guiGetPosition ( logPane, false ) outputDebugString("getpos") lodW, logH = guiGetSize ( logPane, false ) outputDebugString("getsize") vehLog[pVeh] = guiCreateScrollPane ( logX, logY, logW, logH, false, mainWnd.window ) outputDebugString("createscroll") outputDebugString(tostring(isElement(vehLog[pVeh]))) guiSetVisible ( vehLog[pVeh], false ) outputDebugString("setvis") end outputDebugString("if end") i know it isnt clean code but take a check and see if it does it in order (if start ... getpos ... getsize.. createscrolll ... true .. setvis...if end) Link to comment
Deltanic Posted May 25, 2011 Author Share Posted May 25, 2011 I see, the width of the scrollpane is nil. Obviously MTA bug, since nothing what I do solves it. But, when I fill in the width manually, the scrollpane will be created. But the thing I want still wont work. Doing guiSetVisible ( vehLog[pVeh], true ) later-on will return no error, but I dont see anything though. Also, outputting tostring ( vehLog[pVeh] ) just after the scrollpane has been created will output other userdata then outputting that in another file, where I want to show the scrollpane. E.g: create.lua outputs: "Userdata: 0005769" show.lua outputs "Userdata: 00057B0" So, those userdata are clearly different. The pVeh value will output everywhere the same though, so that value is not the problem. I'm pretty sure this is a MTA bug, but I need someone to confirm this. I'm getting really stressed because of this, I just want to get it working. Link to comment
qaisjp Posted May 25, 2011 Share Posted May 25, 2011 Check logW variable although i suppose u have already done it Link to comment
Jaysds1 Posted May 25, 2011 Share Posted May 25, 2011 function pVeh = getPedOccupiedVehicle ( localPlayer ) vehLog = {} if not vehLog[pVeh] then logX, logY = guiGetPosition ( logPane, false ) lodW, logH = guiGetSize ( logPane, false ) vehLog[pVeh] = guiCreateScrollPane ( logX, logY, logW, logH, false, mainWnd.window ) guiSetVisible ( vehLog[pVeh], false ) end end -- logPane is a VALID gui scrollpane, with mainWnd.window as parent. -- mainWnd.window is a VALID gui-window ofcourse. Link to comment
karlis Posted May 26, 2011 Share Posted May 26, 2011 function pVeh = getPedOccupiedVehicle ( localPlayer ) vehLog = {} if not vehLog[pVeh] then logX, logY = guiGetPosition ( logPane, false ) lodW, logH = guiGetSize ( logPane, false ) vehLog[pVeh] = guiCreateScrollPane ( logX, logY, logW, logH, false, mainWnd.window ) guiSetVisible ( vehLog[pVeh], false ) end end -- logPane is a VALID gui scrollpane, with mainWnd.window as parent. -- mainWnd.window is a VALID gui-window ofcourse. wtf is even that? Link to comment
qaisjp Posted May 26, 2011 Share Posted May 26, 2011 function pVeh = getPedOccupiedVehicle ( localPlayer ) vehLog = {} if not vehLog[pVeh] then logX, logY = guiGetPosition ( logPane, false ) lodW, logH = guiGetSize ( logPane, false ) vehLog[pVeh] = guiCreateScrollPane ( logX, logY, logW, logH, false, mainWnd.window ) guiSetVisible ( vehLog[pVeh], false ) end end -- logPane is a VALID gui scrollpane, with mainWnd.window as parent. -- mainWnd.window is a VALID gui-window ofcourse. wtf is even that? lol all he did was add function and end. -.- Link to comment
Deltanic Posted May 26, 2011 Author Share Posted May 26, 2011 He added "function block end". That newbie probably doesn't know that I'm an experienced scripter, though my signature should make that clear... I'm only posting the part people need, not the whole script. He even forgot the () part after function Link to comment
Jaysds1 Posted May 27, 2011 Share Posted May 27, 2011 I left it like that because you could put anything there if u want. Link to comment
karlis Posted May 27, 2011 Share Posted May 27, 2011 no you just don't even understand the problem, but want ur post count up, face that. Link to comment
Deltanic Posted May 27, 2011 Author Share Posted May 27, 2011 I left it like that because you could put anything there if u want. L2script. 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