Jump to content

csiguusz

Members
  • Posts

    500
  • Joined

  • Last visited

Everything posted by csiguusz

  1. csiguusz

    table.remove

    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.
  2. csiguusz

    table.remove

    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?).
  3. csiguusz

    table.remove

    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).
  4. csiguusz

    table.remove

    Could you please explain why not? myTable != i
  5. csiguusz

    table.remove

    So v is an another table, i got it, and of course: you are welcome.
  6. csiguusz

    table.remove

    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
  7. csiguusz

    table.remove

    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 ].
  8. csiguusz

    table.remove

    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
  9. csiguusz

    table.remove

    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?
  10. csiguusz

    table.remove

    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.
  11. csiguusz

    table.remove

    Hm, I made a few tests with it and worked perfectly. So lets find out an another method..
  12. csiguusz

    table.remove

    No, I don't think it will skip any.
  13. csiguusz

    Fuel system

    You are right, a few active people help those who just come and ask something then leave. But I like helping them...
  14. csiguusz

    table.remove

    for i, v in ipairs ( myTable ) do while not isElement( myTable[ i ] ) do table.remove( myTable, i ) end end
  15. csiguusz

    loggin admin

    Mabye the event is only triggered for the admin and not for all players?
  16. csiguusz

    Fuel system

    Okay, I'm glad you made it
  17. csiguusz

    Fuel system

    I did not understand your problem, what button are you speaking about?
  18. 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.
  19. csiguusz

    loggin admin

    Sorry... I made the command just for testing and then forgot to change it back before posting.
  20. csiguusz

    loggin admin

    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
  21. 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)
  22. csiguusz

    loggin admin

    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
  23. csiguusz

    Fuel system

    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.
  24. +1 Dont' just copy, try to understand.
×
×
  • Create New...