Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by 4O4

  1. Actually I've made a simple native server module for exactly this purpose - to pass some configuration or secrets via env variables to the MTA server running in docker container. There is a "getSystemEnvVariable(string variableName)" function there (no "set" counterpart as I didn't need it, but could be implemented easily). Currently I haven't published any releases of .dll / .so but the code is available on Github and you can build it yourself easily: https://github.com/4O4/mta-ml-sysutils Generic building instruction is: run "utils/premake5 gmake && cd Build && make" on linux, and on windows run: "utils/premake5.exe vs2019" and then open Build/*.sln file in visual studio and launch build from there. After a successful build the dll / so will be in Bin/ folder. If you need help with building or want me to publish binaries built by me on github releases, just let me know. This module also includes a second utility function "executeSystemCommand(string systemCommand, function commandFinishedCallback(exitCode, stdout, stderr))" for executing system commands asynchronously in a separate thread, although I ended up not using it very much so I don't know about its stability. Should work but no guarantees, I'm just informing you that it exists in the same module and that's why it is called "sysutils".
  2. One line of minified code, both with and without the upcoming update . Awaiting the cookie!
  3. This question has already be answered in another topic titled exactly the same as this one and laying in the same subforum
  4. 4O4

    HTTPS Server

    Nginx reverse proxy is the best and safest workaround IMHO. Although you need to learn how to configure it properly.
  5. GuiSetInputEnabled GuiSetInputMode
  6. You need to implement mute handling in your globalMessage function, check IsPlayerMuted
  7. It must be Player, but not necessarily a variable named "player" (which was nil in your case, because you never told your script what it is). Both of your functions are executed by some events, and all events have a source (which is also a special variable available in scope of the function that gets executed by event). If you open the documentation page on wiki for onPlayerWasted you can see that in this case the source of event is some Player. There is plenty of information on wiki, so you just need to learn how to use it properly. Follow the links and read everything which is related to the functions or events you want to use. Start by clicking on "source" link and you will see all information about event system Then check some Lua tutorials to learn about variables, scopes, functions etc., there are links on main wiki page too (https://wiki.multitheftauto.com/wiki/Main_Page, General Lua Help section).
  8. It is almost impossible to debug without a test script. Can you provide one?
  9. Hi, please use Code button next time you are pasting Lua code if getPlayerTeam == Infected then This condition looks bad and it is probably never true. getPlayerTeam is a function so it should be called - check wiki for examples. Also, Infected should probably be quoted if it is team name literal. function removePlayerZombie() if getElementData (player,'zombie',true) It is throwing warning, because you haven't defined "player" anywhere. It should probably be "source" in your case instead.
  10. Good job @Jusonex! @AfterAll14 just a quick note - don't forget to re-run premake (create-projects.bat) after you pull this fix from git, because faulty command is saved in projects, so they must be fully regenerated.
  11. Never use special characters or spaces in file / directory names during development, it will save you a lot of time in the future. I bet it is your "MTA SA" folder that is causing the problem
  12. Okay, you can PM me if you want.
  13. Sorry, I'm unable to reproduce your issue. I tried all your code and it didn't throw this error. The problem might be somewhere else and I think you have to debug it all by yourself.
  14. Yes, it can be done with shaders and renderTargets. Check out this topic, it might help you a bit: viewtopic.php?f=91&t=65746
  15. Despite some minor errors this code looks ok. Post the main chunk of code in which you're creating LobbyManager instance and adding a Lobby. There must be a problem with that part.
  16. fileCreate("sub/folder/file.ext") creates a file and also all needed parent directories if they don't exist (sub/folder in this case).
  17. Well I'm dealing with this problem on Trucking server and this can be really annoying. It hasn't been fully fixed for many years in MTA. SetElementSyncer doesn't work at all, I tried it many times without any success. I'm personally using interval function to reattach streamed in trailers every 3 secs. I've also enabled ghostmode on all trailers because they're sometimes flying and hitting clients around the road. This is the best solution I found and have been using it for about 9 months now without any problems. Of course there are some cons and I'd be happy to hear if anybody found better ways of scriptside syncing because I doubt it will ever be fixed in MTA itself as it's being delayed all the time in bugtracker One more advice - don't rely on clientside trailer events because they are sometimes triggered on detach caused by desync and sometimes not. Serverside trailer events are more relialble.
  18. You don't see it because it's created out of window box. X and Y coordinates are relative to parent, parent is shaderPanel so you don't need to add window's x and y coordinates anymore. Replace: local checkBox1 = guiCreateCheckBox ( x1+spaceX, y1+spaceY, cWidth, cHeight, "Water Shader", true, false, shaderPanel) with: local checkBox1 = guiCreateCheckBox ( spaceX, spaceY, cWidth, cHeight, "Water Shader", true, false, shaderPanel)
  19. It seems like Lobby:New(player, ...) isn't returning anything. Can't really tell anything more without the rest of the code.
  20. 4O4


  21. How exactly are you calling AddLobby method? Please show more code.
  22. Oops! You're right, my bad. I've been always using custom team elements and forgot that this doesn't work by default. I'll edit the code.
  23. You're defining local team variable in line 9 and it only exists in that scope. For more information check this http://lua-users.org/wiki/ScopeTutorial The for loop is unnecessary. My suggestion is to put lines 9-12 just after "local acc..." so all of your code that depends on "team" is in the same scope. Also the for loop needs to be repeated two more times. local function teamChat(message, messageType) if messageType == 2 then cancelEvent() local acc = getPlayerAccount(source) local team = getPlayerTeam ( source ) if ( not team ) then return end if not isGuestAccount(acc) then if getAccountData(acc,"chatc") and getElementData(source, "Vip") == true then local color = getAccountData(acc,"chatc") for _, player in ipairs(getPlayersInTeam(team)) do outputChatBox("(TEAM): " .. getPlayerName(source) .. ": " .. color .. message, player, 255, 255, 255, true) end else for _, player in ipairs(getPlayersInTeam(team)) do outputChatBox("(TEAM): " .. getPlayerName(source) .. ": #FFFFFF" .. message, player, 255, 255, 255, true) end end else for _, player in ipairs(getPlayersInTeam(team)) do outputChatBox("(TEAM): " .. getPlayerName(source) .. ": #FFFFFF" .. message, player, 255, 255, 255, true ) end end outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end addEventHandler("onPlayerChat", root, teamChat)
  • Create New...