Jump to content

IIYAMA

Moderators
  • Posts

    6,058
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. Probably because the custom event you try to trigger is too late. The player has already left the game. Streaming data might be your only option.
  2. If you look closely, MrTasty came with the same solution as I did. Just he had already written the function for it. And yes indeed, it is the solution XML asked for. My solution https://wiki.multitheftauto.com/wiki/DxGetTextWidth Mr Tasty his solution + sample / implementation until ((not words[word]) or dxGetTextWidth(lines[line] .. " " .. words[word], scale, font, colorcoded) >= maxwidth) -- stop if next word doesn't exist to text width would exceed maxwidth if next word was added
  3. math.max(vehHealth - 250, 0) / 750
  4. IIYAMA

    help

    That depends on the event. https://wiki.multitheftauto.com/wiki/Server_Scripting_Events https://wiki.multitheftauto.com/wiki/Client_Scripting_Events https://wiki.multitheftauto.com/wiki/OnClientPickupHit Just read the documentation. Then you know which element is the source and also if there are any parameters passed. Only events can have the `source` predefined variable.
  5. IIYAMA

    onVehicleEnter bug

    A vehicle seat isn't a vehicle model. The vehicle seat: a number represents the location of the player in the vehicle. But a vehicle model: https://wiki.multitheftauto.com/wiki/Vehicle_IDs https://wiki.multitheftauto.com/wiki/GetElementModel if playerBikes[getElementModel( source )] then
  6. No, that is the width you set when creating the column. You need to check the length based on each word or character depending how you want to break it. You can probably break it with a new line, if it supports that. @MTASAPLAYER Not every character has the same width. 1x m = 1 em. It will never look nicely wrapped if you use that method.
  7. @XML There is a dx function for it, you will need to check if the DX text length is the same as the GUI. (make sure you set the same font) If true, then it might work for you. https://wiki.multitheftauto.com/wiki/DxGetTextWidth If false, then you will need to adjust it with a scale factor. 10 words per line reads best! (at least that is for the Dutch language)
  8. Makes no sense. Unless you do not want a (compiled) resource to use those functions. If you nil the function references in your lua resource code, it would have the same effect as if you do not have them. createBrowser = nil With your main request, I can unfortunately not help you since I do not develop MTA. But I can point out where some of the components are located in the source code. https://github.com/multitheftauto/mtasa-blue/tree/master/Client/cefweb https://github.com/multitheftauto/mtasa-blue/tree/master/Client/ceflauncher https://github.com/multitheftauto/mtasa-blue/tree/master/Client/ceflauncher_DLL If you really want this version, then this would best place to ask: https://bugs.multitheftauto.com/my_view_page.php I wish you a lot of luck!
  9. Nope it is not correct. If you have ran the code you would receive an warning at line 4 and 8. Syntax addEvent: bool addEvent ( string eventName [, bool allowRemoteTrigger = false ] ) https://wiki.multitheftauto.com/wiki/AddEvent Syntax addEventHandler: bool addEventHandler ( string eventName, element attachedTo, function handlerFunction [, bool getPropagated = true, string priority = "normal" ] ) https://wiki.multitheftauto.com/wiki/AddEventHandler Correct use: addEvent("example", true) addEventHandler("example", root, function () end) Re-attach to the dynamic root element, the original element. You can't attach elements to the void. Then you can better destroy them. https://wiki.multitheftauto.com/wiki/GetResourceDynamicElementRoot Selectors, please read the documentation carefully: https://wiki.multitheftauto.com/wiki/GetElementChildren https://wiki.multitheftauto.com/wiki/GetElementChild https://wiki.multitheftauto.com/wiki/GetElementsByType https://wiki.multitheftauto.com/wiki/GetElementByIndex https://wiki.multitheftauto.com/wiki/GetElementByID ID's SHOULD BE UNIQUE!
  10. IIYAMA

    [help]mysql

    tostring(getElementData(player, "tag")) .. "tagİmage/" ..tagnumber.. ".png" with concatenation. And error proof scripting. (which is still not ok with this code) This is not Mysql!
  11. 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.
  12. 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:
  13. 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
  14. 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
  15. 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 ] )
  16. 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.
  17. 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.
  18. 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)
  19. 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.
  20. 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])
  21. https://wiki.multitheftauto.com/wiki/TriggerClientEvent instead of return, trigger from serverside to clientside.
  22. 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.
  23. 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.
×
×
  • Create New...