Search the Community

Showing results for tags 'loadstring'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 2 results

  1. dugasz1

    loadstring

    Hello! So i want to load external lua files in my resource and i do it with loadstring (Link). Like this: function loadLuaFile( path ) local file = fileOpen(path, true) if (not file) then outputChatBox("Failed") return else local string = "" local buffer while not fileIsEOF(file) do buffer = fileRead(file, 100) if (buffer) then string = string .. buffer end end loadstring(string)() end fileClose(file) end Loading a few script: loadLuaFile(":shared/oop.lua") loadLuaFile(":shared/test1.lua") loadLuaFile(":shared/test2.lua") And i found a wierd thing. It doesn't matter how many lua files i load in, the memory usage in performancebrowser doesn't change. Is it a bug? Or somehow its recognize this code was loaded in another resource?
  2. Hey, I have a problem with loading script files of maps into an environment. If a map uses "addEventHandler" to e.g. add the event "onClientMarkerHit" it most likely uses the "source" variable inside the attached function. However, this source variable does not exist in the scripts environment. The only way to still make it work at the moment is to let it have access to the _G environment, where the variable seems to exist. Is there a way to make it work without that? Bonsai