-
Posts
6,062 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
Thinking you fixed all errors and warnings. A common thing, but do you always have to be the one that creates them? Also are you always in the server when they appear? Of course not. It seems, I still have a few of errors and warnings in my server. The debug information collector is my solution, see the useful information it collected for me: Warnings Errors
-
Using: loadstring But it is a complex process/project, I do not recommend you to start building it. (and no it isn't just loadstring, it is much more than that) can u give me an example ? local exampleString = ' addEventHandler("onClientRender", root, function () setElementPosition(localPlayer, 0, 0, 100) -- I am stuck... Not funny! end) ' Load the code for a single client! loadstring(exampleString)
-
Using: loadstring But it is a complex process/project, I do not recommend you to start building it. (and no it isn't just loadstring, it is much more than that)
-
You can't replace a timer with a for loop! But you can make the code dynamic with a "for" loop. local glitchesTable = { {"super_sprint", "fastsprint"}, {"fastmove", "fastmove"}, -- etc.! } for i=1, #glitchesTable do local glitchData = glitchesTable[i] local glitchValue = tostring(get(glitchData[1])) local glitchName = glitchData[2] if glitchValue ~= "" then setGlitchEnabled ( glitchName , glitchValue:lower() == "true" ) end end
-
You could edit the code ? "You could edit the code ?" = a very arrogant way of asking somebody his help Instead of that, you can ask it like this: "Can you pls help me with editing the code, so that I understand what I have to change?" If you don't know anything about LUA, you shouldn't ask this in the first place, but follow a tutorial first, study examples and ask specific LUA questions.
-
Changing it's color over time.
-
You could edit the code ? Watch your mouth, don't be so arrogant!
-
if vehplayer then if getElementModel(vehplayer) ~= 582 then else end end
-
+ pairs, loops through custom indexes, like: local tableAsIndex = {} local thisTable = { ["customIndex1"] = 45836, ["customIndex2"] = 45836, [true] = 3246765, [localPlayer] = 547356, [resourceRoot] = 5646745387, [tableAsIndex] = 354654638 -- etc. }
-
Try to find a script which enables: "fastmove" https://wiki.multitheftauto.com/wiki/SetGlitchEnabled These seem to have it: https://community.multitheftauto.com/in ... s&id=11059 https://community.multitheftauto.com/in ... ls&id=5317
-
Debugging isn't just watching the stupid console, it is much more than that. So read this page: https://wiki.multitheftauto.com/wiki/Debugging Read everything! Except for Debugging Performance Issues. The most important subject is: "Debug strategies" So make sure you study especially that one.
-
player is NOT the same as Player This language is upper-case sensitive.
-
Something like this. You have to adjust it to your girdlist. local itemsHeight = rowHeight + 3 local startBoundaryY = top addEventHandler ( "onClientClick",root, function (button, state, cursorX, cursorY) if button == "left" and state == "down" then if cursorX > 300 and cursorX < 400 and cursorX > startBoundaryY then local yPositionOnItemIndex = (cursorY-startBoundaryY)/itemsHeight if yPositionOnItemIndex < rowHeight then -- so without that 3 pixels offset on the top. local itemIndex = math.floor(yPositionOnItemIndex) outputDebugString("item: " .. tostring(itemIndex)) end end end end)
-
You haven't added a wrapper function called pairs in your code?
-
Something like this: local startBoundaryY = 400 local itemsHeight = 30 addEventHandler ( "onClientClick",root, function (button, state, cursorX, cursorY) if button == "left" and state == "down" then if cursorX > 300 and cursorX < 400 and cursorX > startBoundaryY then local item = math.floor((cursorY-startBoundaryY)/itemsHeight) end end end)
-
else if In lua you have to write it like this: elseif
-
[quote name=..&G:..]Any ideas why I get "C stack overflow" here? for s, o in pairs(occupants) do You will only get that error when you are calling a function inside this loop, which is related to the function which contains this loop. This is an example how you get this error: function testFunction () testFunction() end testFunction()
-
Read this: https://www.lua.org/pil/4.3.1.html
-
Random selection is required when there are equal players in each team. Try to replace: local teamName = theTeams[1] To local teamName = theTeams[#theTeams] It seems it was placing players in the largest team instead of the smallest team. If you say it doesn't work, you should tell me WHAT exactly. This is really getting annoying. If you did debug your code correctly(not just the console), you would have figured this out on your own.
-
Selecting players randomly? You never said anything about random players, only (random + 1 by 1) adding player to team. Which is doing that. If you still have your doubts about that, why don't you check theTeams table?
-
Probably because the objects you removed took part in the collision of the floor. You will have to fix that with other objects. (make them invisible) That's the only advise I can give you.
-
Did everybody found the childish 'Easter egg'? If you did, then I am feeling very sorry for your headache... It wasn't meant to be in it, but I couldn't make a 100% serious resource. So I had to program something NOT serious in it, although it is a bit childish. Don't tell others about this 'Easter egg' if you found it, unless you really hate them..
-
local _, _, z1 = getElementPosition (hitElement) local _, _, z2 = getElementPosition (source) if math.max(z1-z2, z2-z1) < 3 then end It does have one bug. If you fall from the sky, it will not trigger. Because you already triggered it when you entered the sky. Or use as detection a colshape. (you don't have to delete the marker) https://wiki.multitheftauto.com/wiki/CreateColSphere @Miika822 as you said... I was still replying, when you did answer your own question.
-
It is not from the gamemode play, but from freeroam. Open [play]/play.zip Open the meta.xml from the zip. Then you see this: <meta> <info author="BrophY" description="A playtest/freeroam mode" version="1" type="gamemode" /> <include resource="freeroam" /> <include resource="spawnmanager" /> <settings> <setting name="*spawnreset" value="onSpawn" friendlyname="Spawn Reset" accept="onSpawn,onServerEmpty,onServerStart" desc="When should a new spawnpoint be chosen?" /> </settings> <map src="broph.map" /> <script src="broph.lua"/> </meta> Remove this line: <include resource="freeroam" /> Like this: <meta> <info author="BrophY" description="A playtest/freeroam mode" version="1" type="gamemode" /> <include resource="spawnmanager" /> <settings> <setting name="*spawnreset" value="onSpawn" friendlyname="Spawn Reset" accept="onSpawn,onServerEmpty,onServerStart" desc="When should a new spawnpoint be chosen?" /> </settings> <map src="broph.map" /> <script src="broph.lua"/> </meta> Save the file. Save the archive. When you click on your zip opened in winrar, it will tell you that there have been some changes. Click on OK and it will save it. /restart play or /start play
-
There is one other, render them at position. "onClientPreRender" setElementPosition