-
Posts
6,058 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
Running the editor parallel with a gamemode? Not with the default MTA editor atleast.
-
Not that I know of, but you can change the order. So instead of starting with a function, you could start with a multiline string. thisString = [[ function getName () end ]]
-
It seems everything is fine. You can't send loaded functions to the other side, because they are bound they their environment. The file and every variable around the function is part of the environment. If you actually could transfer functions, then Lua would also copy all other variables to the other side, in fact the entire Lua file. That would be catastrophic. local test1, test2 function test1 () local testValue = "test" function test2 () print(testValue) end end test1() I would recommend to use 3 files instead. 1 shared with all the functions inside of a table allStuff = { doThis = function () end, doThat = function () end, dontDoThat = function () end } 1 clientside function handlerFunction (key, ...) allStuff[key](...) -- client stuff end 1 serverside function handlerFunction (key, ...) allStuff[key](...) -- server stuff end etc.
-
1 amount = tonumber(amount) if amount then -- loop here else -- inform the user that he has to fill in the amount end 2 local size = table.size(playersT) There is no table.size, only table.getn or #. The source of following error Attempt to do arithmetic on a nil value, that occurs on line 18: local i = size + 1 arithmetic = mathematics: + - / * local size = table.getn(playersT) local size = #playersT
-
Keep it simple. if getElementModel(player) == tonumber(v) then break -- stop the loop when result end
-
Your table is empty, we can't validate that. Fill it up and than use this to visualise it: outputConsole ( inspect(enableGarageFunctions)) Open console (f8)
-
Just try to give it a root, because I am not sure if MTA, can detect multiple items and based on that create a new file root. (xml = fileRoot) <fileRoot> <policemen> <!--<user>(nazwaGracza)</user>--> <user>VaporZ</user> <user>maxeo11</user> </policemen> <policevehicles> <!--<vehicleicle>(idPojazdu)</vehicleicle>--> <vehicle>596</vehicle> <vehicle>523</vehicle> <vehicle>402</vehicle> </policevehicles> </fileRoot>
-
Aren't you saving userdata instead? Anyway, there are 2 things that I notice. 1. You are not unloading your xml file. But unloading 2 non existing files. 2. Your xml file doesn't have 1 root. It has 2 roots infact. @VaporZ
-
Is there a way to remove cars that are spawning in freeroam
IIYAMA replied to J4cobLIVEmain's topic in Scripting
Always English in this section. An addition translation in Polish is fine. Thanks you! -
In general it does matter. A function name is a variable after all. But for MTA(C++) functions you have to make an exception. For some unknown reason they are just as fast as localized functions. (I tested that a while back.) For self created functions, yes localized is faster accessible. Feel free to re-test it. Loop i= 1000 + getTickCount Note, this matters: (but not because it is localized, but because it pre-indexed) local tableRemove = table.remove
-
You do not understand that you have to go through an animation from 0% to 100% in order to even do the animation in the first place? ?
-
You are putting the animation progress to 100% ever frame... That is the same as 0% progress.
-
An animation goes from 0 to 100%. That takes an amount of time. But what if you increase that progress?
-
Use this instead: https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress + onClientRender
-
Use resourceRoot, not getRootElement... or don't even use onResourceStart at all. Just run the line for the animation speed. Because wrong using this event can lead to bugs. Where are you starting the animation? Because it is missing in your code. Without animation you will not notice the difference. --------- P.s you might need this instead because it doesn't allow you to go faster than 100% = 1. https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress
-
That is not ging to work. The GTA engine will adjust the running speed to the default until the ped leaves the ground. You could try to use a walk animation and speed it up: https://wiki.multitheftauto.com/wiki/SetPedAnimationSpeed
-
(Mobile) dxDrawText(v, startRectangleX, posY-startRectangleY+i*57, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") > This is not scaled. Take a closer look at how you did that with the rectangle. dxDrawText(v, startRectangleX, posY-startRectangleY+i*57, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") > dxDrawText doesn't make use of sizes. But end points. (startpoint + size = endpoint) Overall, > mirror what you did with the rectangle. > use endpoints instead of the size. > center the text vertically. Between the 2 startpoints and the 2 endpoints.
-
Did you already check the community? I saw a resource where an object is used to force the camera to first-person. Also please don't bump, not everybody has every hour time to checkout the posts.
-
Don't use "onPlayerJoin", for downloading. Client checks for files. client > server Tells the server which files there are already. The server compares the files. The server downloads the files from the external server. (Caching files for a 1 minute?) server > client The server sends the files back. Client loads the mods either from already downloaded files or directly from the RAW data. Best to load the mods that are already downloaded at this moment. As you might want to update mods in the future. There is no onPlayerJoin in that cycle.
-
You need to write the txd data to the file but not the loaded txd.
-
Why are you trying to write a loaded txd? > fileWrite(file, txd)
-
You do not have to use filepaths serverside, as there are URL's. But you do need something to compare the downloaded files with the (serverside) URL's. That is when you need an identifier. You could use the URL for that, as it is always unique. Your approach sounds correctly.
-
Compare filesizes, best way to validate if the file is incorrect. There is only 1 way to figure that out and that is to debug every step. And every variable that plays an important role. The update function is used to update the file, when you have replaced the old one with with a new one. This is something for the future. Line 70 is using the filepaths that are the old ones. Line 72 is delivering the new ones. Meta doesn't make use of include tag. <include resource="xmlData" /> Line 65 it's value should be set after onClientResourceStart.
-
Loop in line 26 is not required. Keep in mind that you might want to update 1 of the files instead of both. When you update/create the filepaths you also need to save the files. As well as saving the filepaths in the xml saving resource.