Jump to content

IIYAMA

Moderators
  • Posts

    6,058
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. Your internal db should already have tables. Try to re-save the database.
  2. IIYAMA

    Help

    addEventHandler("onPedWasted", root, function (_, killer) -- a ped died end) Start with /\ I will help you more if you actually put energy in it yourself, which you are not doing at the moment. Good luck.
  3. IIYAMA

    Help

    Yes, I understand that already. So I helped you a bit with it. Now start with writing your example.
  4. IIYAMA

    Help

    If you want to make an example, then isn't it correct of me to give you the right syntax for it? ???
  5. How about xml? https://wiki.multitheftauto.com/wiki/XML
  6. hmm good quest. (to be honest never done it with the internal db, I did misread that part) You should start with viewing the structure of the db itself, with for example this tool: https://github.com/sqlitebrowser/sqlitebrowser This will also tell you if the db is protected (or the data is protected) in anyway. If everything is fine, then you should be able to connect with it the same way as with a regular db. If that doesn't work and yet your viewer does do the job, then you might need to convert the db to another version.
  7. IIYAMA

    Help

    You want to eat zombies. ! This will tell you, when you have eaten your zombie: Client https://wiki.multitheftauto.com/wiki/OnClientPedWasted Server https://wiki.multitheftauto.com/wiki/OnPedWasted bon appétit / eet smakelijk / enjoy your dinner !
  8. Only one way to go. Remove all vehicle sounds and give them all new sounds with playSound. Other ways do not exist at the moment. (1-5-2018)
  9. Before you can store or receive data, it requires tables as containers. Not the best site, but it explains the basics on how to create a table. http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_create_table.asp.html Also handy: http://www.tech-recipes.com/rx/36940/sql-server-check-if-table-or-database-already-exists/
  10. You want to close it, but: There is one thing that you might consider handy, if you want every player to have to same camera speed. local velCam = 0.02 * (timeSlice / 17) Parameters float timeSlice timeSlice: The interval between this frame and the previous one in milliseconds (delta time). https://wiki.multitheftauto.com/wiki/OnClientPreRender Good luck with developing/finishing it!
  11. Because I am not asking the user to learn also oop and everything is already available on that page.
  12. They are not mta elements. But there are functions that can get the position and rotation of them. I am very sure that you have already found them. Find them if you haven't! ......... ............. ........... .............. .......... After that. The function getElementMatrix can help you with the vehicle orientation. https://wiki.multitheftauto.com/wiki/GetElementMatrix And on that same page there is something that creates a matrix the same way as the function above. But gives you also the ability to get the matrix without using an actual element. (Last example) function getElementMatrix(element) local rx, ry, rz = getElementRotation(element, "ZXY") rx, ry, rz = math.rad(rx), math.rad(ry), math.rad(rz) local matrix = {} matrix[1] = {} matrix[1][1] = math.cos(rz)*math.cos(ry) - math.sin(rz)*math.sin(rx)*math.sin(ry) matrix[1][2] = math.cos(ry)*math.sin(rz) + math.cos(rz)*math.sin(rx)*math.sin(ry) matrix[1][3] = -math.cos(rx)*math.sin(ry) matrix[1][4] = 1 matrix[2] = {} matrix[2][1] = -math.cos(rx)*math.sin(rz) matrix[2][2] = math.cos(rz)*math.cos(rx) matrix[2][3] = math.sin(rx) matrix[2][4] = 1 matrix[3] = {} matrix[3][1] = math.cos(rz)*math.sin(ry) + math.cos(ry)*math.sin(rz)*math.sin(rx) matrix[3][2] = math.sin(rz)*math.sin(ry) - math.cos(rz)*math.cos(ry)*math.sin(rx) matrix[3][3] = math.cos(rx)*math.cos(ry) matrix[3][4] = 1 matrix[4] = {} matrix[4][1], matrix[4][2], matrix[4][3] = getElementPosition(element) matrix[4][4] = 1 return matrix end With this matrix you can attach stuff with a render event. Of course I understand that it might look a little bit complex. But it is really the only way without doing very complex calculations.
  13. Everything you need is on this page: https://wiki.multitheftauto.com/wiki/GetElementMatrix Use getElementMatrix on to the camera element to get it's matrix. And use the functions in the examples to get the offset from the orientation(matrix) of the camera. Which you can later move to with your camera. It gives you a lot of freedom to do really crazy stuff.
  14. I wouldn't say that so quickly. To me his example looks valid. /add d six random[x] = y (or overwrite, `set` would be a better command based on it's functionality) /rem d if random[x] then random[x] = nil end
  15. In here: https://wiki.multitheftauto.com/wiki/Shader_examples Texture names <
  16. https://wiki.multitheftauto.com/wiki/IsTransferBoxActive See the example of that page.
  17. No, add it ONLY to the resource which is going to hide the bar. This makes sure that the script is downloaded before others and starts early on. If you do not do this, this script will be started after the download bar is finished. Check isTransferBoxActive, because it half of your work: https://wiki.multitheftauto.com/wiki/IsTransferBoxActive Use https://wiki.multitheftauto.com/wiki/DxDrawRectangle To cover up the download bar. (enable postGUI) Syntax bool dxDrawRectangle ( float startX, float startY, float width, float height [, int color = white, bool postGUI = false, bool subPixelPositioning = false ] ) Do not cover the whole screen. Keep the user in control. http://bokardo.com/principles-of-user-interface-design/#keep-users-in-control Trouble with using this with onClientRender? This might be handy:
  18. https://wiki.multitheftauto.com/wiki/Meta.xml <download_priority_group /> If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources. + See example of isTransferBoxActive. \/ https://wiki.multitheftauto.com/wiki/IsTransferBoxActive
  19. Hmm interesting. It isn't bug free yet. For example if you destroy a vehicle and create a vehicle at the same time, the event wouldn't be triggered. A more accurate way would be using an invert loop, which checks if the vehicle's at the end of the table are new. If not, then you can break the loop. New vehicle's should be afaik always at the end.
  20. IIYAMA

    "str" to str

    Or you can use loadstring. local value = true loadstring("text = " .. tostring(value))() https://www.lua.org/pil/8.html @Megadreams hmm interesting, I didn't know that you could also make global variables like that.
  21. The latest thing you can do to improve the load + download time for a lot of players, is achieved by compile the script files: https://luac.multitheftauto.com/ Reduces load and download time. But do not enable Extra obfuscation. Because this will increase the load time. (Except if you want nobody* to have Access to it)
  22. iprint(getAllPlayerInDimension (0)) First debug. After executing the function, it returns a table which contains all players from that dimension. Just run the code and check your debug-console.
  23. Well you might be able to make it with: "onVehicleEnter" -- > save ------------------- "onPlayerDamage" -- maybe a delay? (not sure) isPedInVehicle -- > no vehicle? -- > fall off
  24. No.no.no getRootElement is a function. root is a predefined variable that contains the root element. When you execute getRootElement it will return the value: root element: getRootElement == root -- false -- call the getRootElement function getRootElement() == root -- true So yes, in the end it doesn't matter which one you use. Except that with getRootElement you have to make one function call more before you have access to the value.(performance)
  25. See my post, I did edit it afterwards.
×
×
  • Create New...