Jump to content

IIYAMA

Moderators
  • Posts

    6,062
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. IIYAMA

    [help]

    You can get length of the sound with the functions I also posted. For the timer update use your own imagination. I would personally go for onClientRender, because it is smoother. But a fast timer could do the job too.
  2. IIYAMA

    [help]

    https://wiki.multitheftauto.com/wiki/GetSoundLength https://wiki.multitheftauto.com/wiki/GetSoundPosition Try this: local progressBarPosition = math.floor((position / length) * 100) Stop double posting, it is annoying.
  3. IIYAMA

    One question

    That depends when you need to draw the images. If they do have priority to be downloaded before the resource starts, then it doesn't matter. There is also a function in the mta config to download resources from another server, if you are worried about the server bandwidth.
  4. Because this: driveInAndGo = {596, 597, 598, 416, 533} Is the same as: driveInAndGo = {[1] = 596, [2] = 597, [3] = 598, [4] = 416, [5] = 533} You only don't see the index fields. [<index>] = <data> local data = driveInAndGo[index] print(data) true = yes, false = no if true then --do stuff else -- false or nil --do other stuff end
  5. Afaik returned arguments from functions do not unpack more than one place, if you placed arguments behind it. function getNewArgumentsFromFunction () return "test1", "test2" end function lastCallFunction (parameter1, parameter2, parameter3) print(parameter1, parameter2, parameter3) end lastCallFunction (getNewArgumentsFromFunction(), "test3") Result: test1 test3 nil To solve that issue, you have to insert them one by one. You have to correct it by yourself.
  6. ? driveInAndGo = {[596] = true, [597] = true, [598] = true, [416] = true, [533] = true} ? if driveInAndGo[getElementModel(Vehicle)] then
  7. https://www.w3schools.com/sql/sql_insert.asp Use Google first, it is 10000000000000000000000000000000x smarter than me.
  8. ID should be handled by the database, not by LUA. (unless you have special reason for that) And make sure you define the column names before inserting.
  9. IIYAMA

    Mta sa server

    I never said you had to start it... Your scripts are bad, so you blame the server which can handle that amount of players if the scripts are optimised. @Oussema This is the scripting section, for scripting and not for discussing a future vps. Thank you for reading the section rules.
  10. IIYAMA

    Mta sa server

    No, shutdown your server, that will definitely fix it. This is the scripting section!!!!! O.M.Cow
  11. It should be logic that the server doesn't come in between.
  12. By draw something on top of it.
  13. Too much code guys. Try this: function getPlayersTrainSpeed () local veh = getPedOccupiedVehicle ( localPlayer ) if veh and getVehicleType (veh) == "Train" and not isTrainDerailed (veh) then local speed = getTrainSpeed ( veh ) outputChatBox ( "Viteza ta: " .. speed, 255, 0, 0 ) if speed > 30 then -- fill in the speed pls setTrainDerailed ( veh, true ) end end end addEventHandler ( "onClientRender", root, getPlayersTrainSpeed )
  14. IIYAMA

    question

    function add(c,d) return c + d end a = 5 a = add(a,5) print(a) -- print 10 Even though it kinda useless. You better do it like this: a = 5 a = a + 5 print(a) -- print 10
  15. function getPlayersTrainSpeed ( source, command ) @CodX Where do you see parameters here: https://wiki.multitheftauto.com/wiki/OnClientRender ? I don't see them, because there are none. So you can't add them there. Use localPlayer instead of source, without parameters. outputChatBox Doesn't require a player to send to, pls check the syntax.
  16. It is very useful for repeating (dx) animations. local duration = 4000 -- ms local progress = getTickCount() % duration / duration -- progress 0 t/m 1
  17. onClientRender + getTrainSpeed + setTrainDerailed
  18. The default value of number is 0 and doesn't exist in the table customPanels. There is only: -2, -1, 2, 3, 4, 9, 20, 21.
  19. thing contains a nil value. Make sure it contains a table.
  20. You guys can't do that like that. This is a table WTF [9] = { vehicles = { { 538, "Tren" }, }, vehiclesColor = { 6, 6, 6, 6 }, tren = (function () local tren = createVehicle(2864.8310546875, 1291.5625, 10.8203125,13) setTrainDerailable(tren, false) outputChatBox("Test.", source, 255, 255, 0) warpPedIntoVehicle(source, tren) setTrainSpeed(tren, 1) return tren end)(),
  21. True, yet this one is different. Fully automatic finding all the scripts. Copying other files to the new folder so you have 2 versions. And most of all, this one you have to install yourself. Which might be an achievement for some people.
  22. The centre of the vehicle should be inside the col, otherwise it shouldn't be triggered. Also you have to take in consideration, that when you use colshapes it can fail to detect elements when they are already inside. This is a big problem serverside, yet for clientside it should be fine. If you can't get it to work use getElementsByType with streamedin argument ON + getDistanceBetweenPoints3D, to solve the issue.
  23. Scripts can always be stolen, because one way or another the scripts become loaded into the memory. But even if they decrypt it, it will not look the same as you wrote it. Not user friendly at least, since all variable names are gone after compiling. Looking for this?
  24. I didn't misunderstand you, you just did forget half of the information so I couldn't understand you. There are so many ways why this might fail and give the exact same error, at the moment I can only guess. He should try to use the call function instead of exports to insure that the export arguments are successfully transferred. He should learn to debug his code properly, not just waiting for errors and warnings to show up.
  25. The variable that contains the database connection is nil, as simple as that. If this variable contains a nil value, you should cancel the event onResourceStart so the resource doesn't start. Without database connection / database the script wouldn't be working correctly in most cases. Here is where the script probably failed to connect: https://wiki.multitheftauto.com/wiki/DbConnect
×
×
  • Create New...