Jump to content

Strange GUI-happening, my problem or MTA bug?


Recommended Posts

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

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

Link to comment

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

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