Jump to content

thisdp

Scripting Moderators
  • Posts

    535
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by thisdp

  1. because of "setfenv" And also, I recommend you to learn LUA weak table if you don't know.
  2. wind = dgsCreateWindow(0.2*sW,0,0.4*sW,0.4*sH,"Example Scroll Pane (exclude this window)",false) pane = dgsCreateScrollPane(20,0,200,200,false,wind) dgsScrollPaneSetScrollBarState(pane,false) scrollbar = dgsCreateScrollBar(0,0,20,180,false,false,wind) dgsSetProperty(scrollbar,"theScrollPane",pane) dgsSetProperty(scrollbar,"functions",[[ local scb = dgsScrollPaneGetScrollBar(dgsElementData[self].theScrollPane)[1] dgsElementData[self].multiplier = dgsElementData[scb].multiplier dgsElementData[self].length = dgsElementData[scb].length ]]) addEventHandler("onDgsScrollPaneScroll",pane,function(vertical) dgsScrollBarSetScrollPosition(scrollbar,vertical) end) addEventHandler("onDgsScrollBarScrollPositionChange",scrollbar,function(value) local scbs = dgsScrollPaneGetScrollBar(pane) dgsScrollBarSetScrollPosition(scbs[1],value) end) gdlt = dgsCreateImage(0.5,0,1.1,1.1,_,true,pane,tocolor(255,255,255,255)) gdlt2 = dgsCreateImage(0.1,0,0.7,0.7,_,true,pane,tocolor(0,255,255,255)) With the latest DGS, this is an example to handle your situation.
  3. The first "print" prints "function" The second "print" prints "nil" I am afraid that you didn't test my code. If you think it is false without test, then it is false anyway. I don't care.
  4. No need to unload, because the variables won't affect the _G table, this means everything is "local" which will be marked by garbage collector after they are useless (If you know how lua garbage collector works you will understand what I have said). The code has passed my test. In terms of your request, the code works. For the "local" variables, there is no way to get their name unless they are "global".
  5. i am working on a new function to solve your question. As soon as the new function finishes, i will post the method to realize what you want. thanks for your supports.
  6. local buffer = [[local sx, sy = 0, 0 globalVar = 'test string' function testFunction() end local function testFunction2() end]] buffer = buffer:gsub("local","") local fnc = loadstring(buffer) local gTable = {} setmetatable(gTable,{__index=_G}) setfenv(fnc,gTable) fnc() for k,v in pairs(gTable) do print(k,v) end
  7. because "listaEmpregos" is a local variable in function "MarkerHit"
  8. why not outputChatBox(selected) ?
  9. watch your debug message. about the "DGS" perfix: DGS = exports.dgs is always used. But i recommend you to use this instead loadstring(exports.dgs:dgsImportFunction())()-- load functions label = dgsCreateLabel(0,0,0.5,0.1,"text",true) --create a label
  10. dgsSetProperty(progressbar,"bgColor",tocolor(r,g,b,a)) dgsSetProperty(progressbar,"indicatorColor",tocolor(r,g,b,a))
  11. Ah, i am wrong.. After thinking for a while, i found the algorithm is a little bit complicated..
  12. Tell you the truth, getDistanceBetweenPoints2D and findRotation doesn't work accurately in this case.
  13. addCommandHandler("test",function(player,command,...) local args = {...} print(#args) --How many arguments are passed end)
  14. Because onDgsMouseClick triggers twice when you click a button, press and release
  15. DGS is a resource, all the functions provided are exported.
  16. If you use dgs, then detect area is ready for you. It uses dxGetTexturePixels, but optimized.
  17. Ah.. It is not too difficult for a scripter
  18. Tell you the truth.. The slowest part may be the dx functions..
  19. I rewrote the script by myself according to the BTTFHV team's server.
  20. Are you seeking for this? This is my unfinished BTTF script https://m.youtube.com/watch?v=G6bhcaF0I_A
  21. if getVehicleComponentRotation = handlingGetSteeringLock then To if getVehicleComponentRotation == handlingGetSteeringLock then But, your code still seems to be incorrect logically.
  22. Create a queue, and deal with it inside "onClientRender". For example, 200 objects will be created in 1 frame.
×
×
  • Create New...