JeViCo

Members
  • Content Count

    478
  • Joined

  • Last visited

  • Days Won

    1

JeViCo last won the day on April 21

JeViCo had the most liked content!

Community Reputation

77 Popular

2 Followers

About JeViCo

  • Rank
    Hustler

Recent Profile Visitors

1,638 profile views
  1. JeViCo

    I need a little advice with metatables

    What do you mean? It removed function once and spams now or what?
  2. JeViCo

    I need a little advice with metatables

    @IIYAMA same problem idk why 1-st lua file function destroyDX(element) local dx_type = getElementType(element) if dx_type == "dx-window" then JVwindow.destroy(source) elseif dx_type == "dx-button" then end end addEventHandler("onClientElementDestroy",root,function() if getElementData(source,"dxcore") == true then cancelEvent() destroyDX(source) end end) 2-nd lua file function JVwindow.destroy(element) local dat = getElementData(element, "variable-data") if #dat.main.related_elements > 0 then for _, el in ipairs(dat.main.related_elements) do destroyElement(el) end end removeEventHandler("onClientRender", root, dat.handlers.render) setmetatable(dat, nil) destroyElement(element) end errors: I thought cancelEvent() didn't work but nope print(element) returns userdata so element exists
  3. JeViCo

    Lua module installing?

    wtf why did i miss it, Thank you so much
  4. JeViCo

    Lua module installing?

    Can i install utf8 Lua module somehow? I need lua string-matching functions to use russian letters
  5. local table1 = {"1", "2", "3"} local table2 = {"2", "3", "1"} function sameTables(tab1, tab2) local endTable = {} if #tab1 == #tab2 then for _, v in ipairs(tab1) do local check for _,v2 in ipairs(tab2) do if v2 == v then check = true break end end if not check then break return false end end else return false end end @IIYAMA can i write 'break' twice to stop both loops?
  6. JeViCo

    I need a little advice with metatables

    I checked my code and that's true - all data saved except for functions i'll try to rewrite functions using elements only and connect them with metatables with elementData
  7. Hello everyone :3 I tried to make my own dx-gui system. I separate functions into several .lua files (i have a window and a button) So i used this to destroy elements in 3-rd file addEventHandler("onClientElementDestroy",root,function() if getElementData(source,"dxcore") == true then triggerEvent("destroy-"..getElementType(source),localPlayer,getElementData(source,"variable-data")) end end) -- getElementData(source,"variable-data") returns table (all info about this dx element in metatable) 1-st file: function JVbutton:destroy() -- remove stuff (button) end addEvent("destroy-dx-button",true) addEventHandler("destroy-dx-button",root,function(data) data:destroy() end) 2-nd file function JVwindow:destroy() -- remove stuff (window) end addEvent("destroy-dx-window",true) addEventHandler("destroy-dx-window",root,function(data) data:destroy() end) but i keep getting same errors: ( attempt to call method 'destroy' a nil value) What am i doing wrong?
  8. Sup guys I have 2 tables with same values but they're in different order -. I'm looking for better method to compare this 2 tables without losing performance
  9. that's rather hard to understand at the moment. I'll try to make some experiments with it. Thank you anyway =3
  10. Hello everyone! I tried to make something like this: 1-st resource (where i calculate everything) function choosed(colors) if choosed then return colors else return false end end addEventHandler("onDGSPickerChoose", getRootElement(), choosed) 2-nd resource (where i use data to make something awesome) addEventHandler("onDGSPickerChoose", getRootElement(), function(rgba) --i use rgb stuff here end) I'm not sure that i'm doing it right
  11. JeViCo

    Difficulties with Lua patterns

    Thank you so much. Now i understand patterns a little bit more
  12. JeViCo

    Difficulties with Lua patterns

    it works! Thank you. So how did you do that? ( ) means subpattern and ^ at the beginning and $ at the end of string mean - 'match whole string from the start till the end' Am i right?
  13. JeViCo

    Difficulties with Lua patterns

    same result
  14. JeViCo

    Object Preview

    @TorNix~|nR you should add empty file server side with name "gui_skin.png" and add it to meta.xml with download="false" property or you'll get error on 7-th line @Ren_712 could you fix a problem above ? object_preview creates 2 objects on screen if second render target's value = true
  15. JeViCo

    Difficulties with Lua patterns

    Hello everyone. I've recently tried to make roleplay nickname pattern (example: Nicolas_Cage) but it doesn't work properly addCommandHandler("checkName",function(pl) local name = getPlayerName(pl) if string.match(name,"(%u?)(%l+)%_(%u?)(%l+)") then outputChatBox("rp nickname") else outputChatBox("nonrp nickname") end end) I can use Nikolas_CAgE and it'll match i used this and this wikis What am i doing wrong?