-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
Google is smarter than me. https://stackoverflow.com/questions/45259879/how-do-i-remove-all-special-characters-punctuation-and-whitespaces-from-a-strin
-
Are your queries limiting the search result? (Just check it if you haven't done it yet, because not doing it can improve the performance with 0 t/m 1000% depending on the situation) 1. Limit search results Your situation: queries are taking too long to complete and your lua memory is waiting for the results.(because you didn't use callbacks) 2. Use callbacks instead of pause the lua memory. 2.1 See also coroutines: https://www.lua.org/pil/9.1.html 3. Last resort You have to queue your queries and let it better work with your internal lua memory.
-
There are already two hex values inside of the string. They will be dominating the colour.
-
You may can up-scale it with a tool like this: https://vectormagic.com/ (desktop version for higher resolution -> trial) But of course the result is not 1/1.
-
For ramming you can edit those: https://wiki.multitheftauto.com/wiki/SetVehicleHandling https://wiki.multitheftauto.com/wiki/SetModelHandling For other damage can you can also cancel the event: https://wiki.multitheftauto.com/wiki/OnClientVehicleDamage (add the health loss to the vehicle it's health, to get the original health) And change HP: https://wiki.multitheftauto.com/wiki/SetElementHealth
-
The shader reference isn't saved in to the variable `shader`. So create a shader and save it in to the shader variable before using it. https://wiki.multitheftauto.com/wiki/Element/Shader https://wiki.multitheftauto.com/wiki/DxCreateShader
-
It is the same for you. Don't post and reply here in the scripting section with code requests. Your post and replies are unwanted according to the section rules. Before posting in this section, please read the rules and have a nice day or two.
-
If you say so, then ok here you are: local players = getElementsByType ("player", root, true) for i=1, #players do local player = players[i] -- do your thing end
-
Learn first what a element, table and a loop is. After that I will provide you with examples, because else you will not understand the code. https://wiki.multitheftauto.com/wiki/Element https://www.lua.org/pil/2.5.html https://www.lua.org/pil/4.3.5.html
-
Because each computer is processing the same code. And localPlayer/getLocalPlayer() is used to get the player that is being controlled.
-
How about you use this tool to make it a lot easier: Syntax: addRenderEvent(function functionVar [, string eventName, arguments ...]) bool removeRenderEvent(function functionVar [, string eventName]) Use: function renderCountDown (text) dxDrawText(text, (screenW * 0.1596) + 1, (screenH * 0.2839) + 1, (screenW * 0.8404) + 1, (screenH * 0.4297) + 1, tocolor(0, 0, 0, 255), 4.00, "bankgothic", "center", "top", false, false, false, false, false) dxDrawText(text, screenW * 0.1596, screenH * 0.2839, screenW * 0.8404, screenH * 0.4297, tocolor(255, 255, 255, 255), 4.00, "bankgothic", "center", "top", false, false, false, false, false) end addRenderEvent(renderCountDown, "onClientRender", 1) -- timer removeRenderEvent(renderCountDown, "onClientRender") addRenderEvent(renderCountDown, "onClientRender", 2) -- timer removeRenderEvent(renderCountDown, "onClientRender") addRenderEvent(renderCountDown, "onClientRender", 3) -- timer removeRenderEvent(renderCountDown, "onClientRender") addRenderEvent(renderCountDown, "onClientRender", "Go!") -- timer removeRenderEvent(renderCountDown, "onClientRender") + <Add source code https://forum.multitheftauto.com/topic/103866-src-client-render-events-enchanting/ />
-
Please, first validate your code before making conclusions like this.
-
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.
-
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
-
math.max(vehHealth - 250, 0) / 750
-
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.
-
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
-
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.
-
@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)
-
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!
-
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 replies
