Jump to content

xScatta

Members
  • Posts

    181
  • Joined

  • Last visited

Posts posted by xScatta

  1. Hey guys!

    Is there a way to get "source Function" ?

    Like this

      
    -- in timer now we can get his source by sourceTimer 
    setTimer(function () outputChatBox("1") killTimer(sourceTimer) end, 1000, 5) 
    -- and it will outputChatBox only once 
      
    

    And the question is:

    Can we get the function variable without a name like this

      
    addEventHandler("onPlayerClick",some player, function (button,state) 
    if button == "left" and state == "down" then 
    outputChatBox("you triggered the event only once! u can't do it anymore!") 
    removeEventHandler(eventName,source,sourceFunction) -- here is what i want to know 
    end 
    end,false) 
      
    

    Because it would be faster way to use.

    Waiting for some help! :)

  2. Yes, it is an array, are you sure? Because i have over 10k keys in it. I mean it looks like this

      
    TBL = { 
    [1] = {blabla}, 
    [2] = {blabla}, 
    [3] = {blabla}, 
    [4] = {blabla}, 
    [5] = {blabla}, 
            [...] 
    [5426] = {blabla}, 
    [5427] = {blabla}, 
    [5428] = {blabla}, 
    [5429] = {blabla}, 
    } 
      
    

    And i think it would take maximum the weight of file in json.

    Now it's about 1,84mb.

    So it will take about 1,84mb of ram?

  3. Hey Guys!

    I have small question.

    When i have table in json, in file, and it weights 1,84mb

    so when i will load it as variable mytable = fromJSON(thedatafromfile)

    how much ram and cpu it will take (the table is in resource already)?

    And when i will use something like mytable[somekey] without repeating whole table to find something cause the script knows which key is what, will it eat much cpu or something?

×
×
  • Create New...