• Content Count

  • Joined

  • Last visited

  • Days Won


IIYAMA last won the day on April 5

IIYAMA had the most liked content!

Community Reputation

661 MTA Ambassador



  • Gang
  • Location
  • Occupation
    I have never been to the streets of SA... so who knows?
  • Interests
    Design, scripting, UX/UI

Recent Profile Visitors

6,917 profile views

    Deal with loadstring & enviroments

    There is a way without reading/writing files and it is not that hard to master. But the downside of that method is that it will be loaded already in your ram as a string, even if you do not use it. -- the script should be between those [[ ]], which is a multiline string. local file = [[ local variable = 1 function example () iprint(variable) end example() ]] function getFile (securityKey) if securityKey == "4GDT^*#46345" then -- < An important layer of security. Compiled scripts might be not be viewed, but that doesn't mean they can't be loaded. return file end end <export function="getFile" type="client"/> call ( getResourceFromName ( "resourceName" ), "getFile", "4GDT^*#46345" )

    Deal with loadstring & enviroments

    You mean protection from stealers? Or access to files from different resources?

    Multi Language

    @holuzs As long as you do not use a database, it will be hardly noticeable. This whole table + it's sub-tables are located in the ram and will be available without much delay. And exporting will use a bit more CPU than a normal function call, but it will save RAM because you only have 1 location for the data.

    Synch question

    As @Zorgman said. A way you can bring serverside and clientside elements closer to each other. server local weapon = createElement("weaponS") client local weapons_s = getElementsByType("weaponS", resourceRoot) for i = 1, #weapons_s do local weapon_s = weapons_s[i] local weapon_c = createWeapon(...) setElementParent(weapon_c, weapon_s) end ElementData can be used to transfer the properties and weapon states. Etc. Ect. Ect. This is a method you have to master, can't be learned with one tutorial.

    Deal with loadstring & enviroments

    Not really, pcall is already running the code. After that you are calling it without pcall again. pcall(loaded) -- call 1 loaded() -- call 2 Note: pcall executions do hide most of the debug information. So even if you did debug it, you wouldn't have noticed it. It is recommended to develop without pcall and when you are finish use it. I also saw you use triggerEvent on the resourceRoot. It is better if you do NOT use that at first. It is very important to understand that you can't just use the same element for all the resources. It will go bad... If you really want to use that. Top: local resourceRoot = createElement("resourceRootFaked") Bottom: triggerEvent("onClientResourceStart", resourceRoot, getResourceFromName("scriptLoaderResource")) And try to use the setfenv function as I have recommended before. In your current code all the global variables are exposed.

    Deal with loadstring & enviroments

    More or less the same way scriptDataString .. "\n do \n" .. loopData .. "\n end \n"

    Deal with loadstring & enviroments

    @Overkillz For each script you run, you are destroying the previous environment by overwriting the 'enviroment' variable. That does not go well. To be honest I haven't worked much with environments. But you will need to use setfenv function for cutting off the environment. Here a tutorial about the way to go, on the very BOTTOM of this page: http://lua-users.org/wiki/EnvironmentsTutorial A recommendation, based on just things that might be handy. Merge all the strings/scripts together and wrap each of them with: do --script end This will make sure that all local variables stay in their scope. An IIFE will do as well: (in case of an overflow of 200+ local variables in total) (function () -- script end)()

    dxDrawRounded using Images

    This function can be used to repeat the same image, it might be possible that they use the rotation/rotationCenterOffsetX/rotationCenterOffsetY property for each new repeated image as offset. But I have never seen anybody do that. So that is UNKNOWN territory for me.

    dxDrawRounded using Images

    Hmm, you could try to generate it with a browser. > browser https://wiki.multitheftauto.com/wiki/CreateBrowser > html + css <section style="width:300px;height:100;background-color:white;border-radius: 25px;"></section> > get https://wiki.multitheftauto.com/wiki/DxGetTexturePixels https://wiki.multitheftauto.com/wiki/DxGetPixelsSize > set https://wiki.multitheftauto.com/wiki/DxCreateTexture https://wiki.multitheftauto.com/wiki/DxSetTexturePixels (or just generate the corners, color = white = #fff is recommended)
  10. IIYAMA

    dxDrawRounded using Images

    See example on this page: https://wiki.multitheftauto.com/wiki/DxDrawCircle (not sure if it works as you want it)
  11. IIYAMA

    elementData equivalent?

  12. IIYAMA

    elementData equivalent?

    Yes those will work just fine. But keep in mind that other resources might also add other children. So it's better to be a little bit more specific. local colshapes = getElementChildren ( vehicle, "colshape" ) local colshape = colshapes[1] -- is the colshape not a direct child? Use: local colshapes = getElementsByType ( "colshape", vehicle ) local colshape = colshapes[1]
  13. IIYAMA

    Can not disable friendyfire for teams

    @ArcAngeL Just to be sure: /start runcode /srun setTeamFriendlyFire ( root, false )
  14. IIYAMA

    Can not disable friendyfire for teams

    Are you sure this code has been executed last?
  15. IIYAMA

    [Sell]Quest Diamonds

    ERROR404 becomes ERROR406 Even though I did hope these posts remain ERROR404...