Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. The table `ped`, does not exist. Don't need to use the table `pedPos` instead? Please read the section guidelines, to learn how to format your code.
  2. IIYAMA

    help

    Root is the top of the elements.(it is an element) https://wiki.multitheftauto.com/wiki/Element_tree Which represents the container of everything. If used in an addEventHandler, every element ingame is capable to trigger/activate it. More information about specifying the trigger range:
  3. Because the function does not exist in mta. From here you can get the function and apply it in your code: https://wiki.multitheftauto.com/wiki/IsPlayerInTeam
  4. IIYAMA

    Table..

    Yes! that is how you should explain it the next time! Communicating with the server The very basic of it. Client function showZoneOutput() -- ... triggerServerEvent("saveDataInTable", resourceRoot, string.format('%.3f', x), string.format('%.3f', y), string.format('%.3f', w), string.format('%.3f', d)) end Server addEvent("saveDataInTable", true) addEventHandler("saveDataInTable", resourceRoot, function (x, y, w, d) zones[#zones + 1] = {id = 1, name = "Test zone", owner = "TsT", ctrl = "", price = 50000, objects = 0, radio = "", x = x, y = y, sx = w, sy = d} iprint(zones) end) Untested. https://wiki.multitheftauto.com/wiki/TriggerServerEvent
  5. You can't do it per id automatic afaik, but you can do it per element. Which means you can do it also per id with lua scripting. https://wiki.multitheftauto.com/wiki/EngineApplyShaderToWorldTexture bool engineApplyShaderToWorldTexture ( element shader, string textureName [, element targetElement = nil, bool appendLayers = true ] ) bool engineApplyShaderToWorldTexture ( element shader, string textureName [, element targetElement = nil, bool appendLayers = true ] )
  6. IIYAMA

    Lua f*k sh*t

    There are a lot of languages that crash if you make mistakes like that. But no, lua gives you and error and keeps working even though the execution of the function stops. It is a very forgiving language, you just have to learn the meaning behind the errors and warnings. > Google < Please be patient. It takes at least a year or two to learn everything before you start making less mistakes in your code.
  7. IIYAMA

    Client + server.lua

    It all depends which computer should execute the code. They run in different environments, even if you run a server on your own device. 1. server (code) Server = computer PING / (~ 2) is IN BETWEEN client and server! = delay = LAG 2. client (same code for every client) client = player = computer client = player = computer client = player = computer etc.
  8. So not clientside.
  9. Maybe you have another function named getLocalPlayer? So many things can cause this. With the code you showed me is nothing wrong. How about you try to use the predefined variable localPlayer instead? (not a function) (If that one returns nil, than the script is being read as a server file)
  10. IIYAMA

    Table..

    Well, show us what you tried. Because I don't understand your issue. If you want clientside and serverside be able to communicate, that can only be done with: setElementData triggerClientEvent / triggerServerEvent I understand that you have trouble with communicating with the English language, but please stay positive. I am reading your text after all.
  11. getDistanceBetweenPoints3D(0,0,z,0,0,endZ) Those values are not optional. You have to fill them in. If they were optional, the syntax would be: getDistanceBetweenPoints3D([float x], [float y], [float z], [float x2], [float y2], [float z2])
  12. https://wiki.multitheftauto.com/wiki/TriggerClientEvent instead of return, trigger from serverside to clientside.
  13. You can not use return to send information to the other side. Sending information cost time(ping) and the code doesn't wait for that. Think about about ping pong. You hit a ping pong ball with a bat and it takes some time before it comes back to you. You need two trigger events to make this work + restructure code.
  14. function acceptHeal() local requestStatus = getElementData(player, "healrequest") if (requestStatus == "pending") then setElementData(player,"healrequest", nil) -- delete it! setElementHealth(player, 100) outputChatBox("You have been healed by the doctor.", player) else outputChatBox("You have no pending request.", player) end end addCommandHandler("aheal", acceptHeal) Wrong named variables. addCommandHandler doesn't have the pre-defined source variable.
  15. @N3xT Working <acl name="Default"> <right name="general.http" access="false"></right> <!-- add here --> <right name="resource.api-test.http" access="true"></right> <!-- ------- --> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.start" access="false"></right> https://files.fm/f/rtbmngd3 And if that file cache problem comes up: https://wiki.multitheftauto.com/wiki/FileRead https://wiki.multitheftauto.com/wiki/HttpWrite
  16. @Galactix Please do requested code in a private message. Else people might think it is normal to request code in this section. I really appreciate your affords for the community!
  17. Ah oke, still the same issue. I thought @MrTasty his input solved your issue. Coming back on that one (as I said before).
  18. With JavaScript of course. Lua is not running in your web browser. https://stackoverflow.com/questions/19592009/html5-video-duration-without-playing-video
  19. @MRThinker Please do not post these requests in this section. See section rules: Thank you very much and have a nice day.
  20. Hmm, I didn't know you were using the file dynamic. https://wiki.multitheftauto.com/wiki/Resource_Web_Access See heading 》Parsed files 《 You can also build an API, which just reads the file and writes the web output. (With the given example you can already build it.)
  21. Hmmmm, interesting. At the moment I do not have much time to test it. But in the future I might need to build an API for my server, so I am interesting in it too. Tomorrow or the day after that, I will write a test resource for this. So if you haven't figured out your issue by then, I will send you this test resource.(If it works xd) Of course I will be here for questions/support. Hang in there, Oke?
  22. You can output your local server (side) debug information to your terminal. Which is in most cases already automatic.
  23. 》This works as with other ACL rights - You can enable it just for Admin users, or any other group of users you wish. 《 https://wiki.multitheftauto.com/wiki/Resource_Web_Access You might have to add it to the *.user group instead. Else it will indeed reconnect you.
  24. To which group did you add it? And what happens if you stop the web browser resource? (Afaik it isn't required)
  25. As I said before.That path can't be accessed, because it isn't public. MTA is the serving the files based on the meta.xml. And FetchRemote is for public web files only. Edit. Hmm I might be wrong about that. https://wiki.multitheftauto.com/wiki/Meta.xml Check out the html meta.xml tag. <html /> src: The filename for the HTTP file (can be a path) default: The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false) raw: The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false) @N3xT More info about the path: https://wiki.multitheftauto.com/wiki/Resource_Web_Access
×
×
  • Create New...