csiguusz
Members-
Posts
500 -
Joined
-
Last visited
Everything posted by csiguusz
-
Yes i know this of course. I just did not understand what was your problem with my code. If i would use v instead, it wouldn't work well, but i've already explained this somewhere above.
-
Sorry I still don't understand. '"i' was already the value from the array?" Hm... In my for loop 'i' was the index and 'v' was the value of the table (array?).
-
I is not the value, it is the index. " myTable == v". And its needed to get it again after we removed one value from the table because so every item in the table after the removed one "went back" one step, and so it can check that the new value that is now on the place of the removed one should be also removed or not ( in this case go to the next value).
-
Could you please explain why not? myTable != i
-
So v is an another table, i got it, and of course: you are welcome.
-
What's this? (weaponObjectsVeh)[1] ? Is it working so? The [1] isn't needed. And what do you mean by smaller? I don't have a better idea, sorry
-
This really doesn't makes sense, just forget to change every variable cause i tested it with something else, it's fixed now . Just try it with v instead of myTable[ i ] . After it removed one value, v won't be equal to myTable[ i ].
-
Ahh, i messed up a bit the variables sorry, will fix it. edit: for i, v in ipairs ( myTable ) do while myTable[ i ] and not tonumber( myTable[ i ] ) do table.remove( myTable, i ) end end
-
Indexes are always number, aren't they? And it wont remove everything, just in some cases it doesn't stop. But I fixed it: for i, v in ipairs ( myTable ) do while myTable[ i ] and not isElement( t[ myTable ] ) do table.remove( myTable, i ) end end Edit: I know an index can be anything (e.g. table["something"] = 1 ). But in this case i would not call it index. Or do you still call it so?
-
That's an exciting problem, but I think I solved it now. I know what was wrong in the first one. But now I had an another idea: local temp = {} for i, v in ipairs (myTable) do if not isElement( myTable[i]) then table.insert( temp, i ) end end for i, v in ipairs(temp) do table.remove( myTable, v-(i-1)) end temp = {} Won't run for ever, and will remove every value from the table, wich fits the condition. Maybe there is some easier solution, I'll be thinking about it.
-
Hm, I made a few tests with it and worked perfectly. So lets find out an another method..
-
No, I don't think it will skip any.
-
You are right, a few active people help those who just come and ask something then leave. But I like helping them...
-
for i, v in ipairs ( myTable ) do while not isElement( myTable[ i ] ) do table.remove( myTable, i ) end end
-
Mabye the event is only triggered for the admin and not for all players?
-
I did not understand your problem, what button are you speaking about?
-
Some files must be downloaded, you cant avoid this, but if you set cache="false" then it wil not be saved on the client's computer. fileDelete does the same thing.
-
Sorry... I made the command just for testing and then forgot to change it back before posting.
-
Hm, strange error. But this should work addCommandHandler("ad", function() addEventHandler("onClientRender", root, logueoadmin) setTimer( function() removeEventHandler("onClientRender", root, logueoadmin) end,7000,1) end) function logueoadmin() dxDrawRectangle(417, 648, 461, 30, tocolor(5, 0, 5, 141), true) dxDrawText( getPlayerName(localPlayer).." (Admin |Lv4|) Ha iniciado sesion", 422, 649, 845, 668, tocolor(200, 0, 0, 141), 1, "pricedown", "left", "top", false, false, true, false, false) end
-
lol, thieves? How could anybody stole your scripts from the server? Use good passwords and it should not happen. You can protect client-sided script files from being read by the players by setting cache to "false" in the meta.xml ( https://wiki.multitheftauto.com/wiki/Meta.xml%20)
-
try this: addEvent("admin", true) addEventHandler("admin", getRootElement(), function() addEventHandler("onClientRender", root, logueoadmin) setTimer(removeEventHandler,7000,1, "onClientRender", root, logueoadmin) end) function logueoadmin() dxDrawRectangle(417, 648, 461, 30, tocolor(5, 0, 5, 141), true) dxDrawText( getPlayerName(localPlayer).." (Admin |Lv4|) Ha iniciado sesion", 422, 649, 845, 668, tocolor(200, 0, 0, 141), 1, "pricedown", "left", "top", false, false, true, false, false) end
-
I think you don't have to set element data every second. Just set/get it when a player enters/leaves the car or when the driver leaves the server or when it become empty or gets refilled.
-
+1 Dont' just copy, try to understand.
