Jump to content

IIYAMA

Moderators
  • Posts

    6,089
  • Joined

  • Last visited

  • Days Won

    216

Everything posted by IIYAMA

  1. IIYAMA

    [HELP]Video

    Yes possible, by feeding it the whole video in base64. https://base64.guru/converter/encode/video Not recommended for large video's. ?
  2. yes that one + https://wiki.multitheftauto.com/wiki/SetPedAimTarget + rotate the ped see also: https://web.archive.org/web/20130728213352/http://crystalmv.net84.net/pages/scripts/npc_hlc.php
  3. That is where you need to create wrappers. It is function overwrite that is executed before the original function, making sure that you can register what has happened (and undo it later). addEventHandler_ = addEventHandler local addEventHandler = function (...) -- collect the information you need, to remove the addEventHandler for a specific file/mode. return addEventHandler_(...) end Check out other multi gamemodes for inspiration.
  4. Afaik elements in other dimensions are not streamedin, also by enabling the streamedin capture feature, the performance will improve getElementsByType("player", root, true) You can add another function, that makes use of the existing function and does for example: draw an X amount of lines under each other. dxDrawMultiLineTextOnElement(roomDeathmatch, {"Deathmatch", 1, 20, 255, 255, 255, 255, 2, "sans"}, { "Deathmatch", 1, 20, 255, 255, 255, 255, 2, "sans"}) function dxDrawMultiLineTextOnElement (element, ...) local lines = {...} -- etc. end
  5. Have you already checked other dx libraries? It would be a waste of time to figure out everything from scratch don't you think? For example:
  6. Use getTickCount (milliseconds) if you do it based on machine time. Use getRealTime().timestamp (seconds) if you want realtime. When doing the calculations, start with the highest dimension. hours = math.floor(seconds / (60 * 60)) seconds = seconds - (hours * 60 * 60) progress = seconds / (60 * 60) You can also use %, to cut off large dimensions. Starting with the dimension you do not needs. Need hours + rest? = cut off days But that doesn't work for days/years, since there are not always 365 days in a year. Progress goes from 0 to 0,9999999999.
  7. I do not know that script, but I can explain Lua OOP a little bit. At the very basic OOP is about creating objects and consider them as things and not just a data type, in Lua that is in this case a table. And as you know, you can add a lot of things in tables. It is a container used to keep things together. In the concept OOP, functions are part of this container as well. To keep things together, all functions that are saved inside can be used as being part of the table(container) it SELF. Which is where the keyword self comes from. Some people refere to `functions` that are inside of tables/objects as `methods`. Because those functions are used to modify or use data from the table, it becomes an action that the table can do. self is a key word, that reference to the table, where a method/function is saved in. If the function is not called from the table(container), self will become unavailable. The concept here is to keep the self/table as close as possible to the action the function must perform. t = {} function t:printSelf() print(self) end t:printSelf() ----- t = {123} function t:getValue () print(self[1]) end t:getValue()
  8. It is possible, but what is the real problem? - The synchronisation concept for the data? Or - How to use OOP?
  9. Unfortunately that might not be the case. For example if you have 2 of those red boxes in each other and rotate 1 of them. There is another method that might be helpful if only 0, 90, 180 270 are used. Step 1, normalize the width, height and depth. So that rotation doesn't play any role anymore. https://wiki.multitheftauto.com/wiki/GetElementBoundingBox getPositionFromElementOffset < https://wiki.multitheftauto.com/wiki/GetElementMatrix Not required: Change your ^imationary^ camera from top to bottom. Get the center position X from both. Compare the distance: distanceX = [positionX_box1, positionX_box2] if distanceX < (sizeX_box1 / 2) + (sizeX_box2 / 2) then Do the same for the Y and Z axis. When all are true, there is a collision.
  10. But keep in mind that the solution is not bullet proof. If the red box was 45 degrees rotated clockwise and moved a little bit higher, the collision detection would fail.
  11. You could also use this function. https://wiki.multitheftauto.com/wiki/IsInsideColShape https://wiki.multitheftauto.com/wiki/GetElementBoundingBox If you run it 8x times for each corner, per object = 16x. Then it will detect most of the collisions, except when no corners are inside each other. There is also something by crystamv. https://web.archive.org/web/20160507103732/http://crystalmv.net84.net/pages/scripts/server_coldata.php But that one only supports peds and vehicles. But you could modify it to also support objects
  12. You can multiply the colshape size by 1.5. But keep in mind that rotation values that are higher than: (rotation % 90) > 0 Will make the calculations invalid.
  13. Moved to correct language section. (Not sure if this is the correct sub-section...???)
  14. @koragg Unfortunately I will be away for a long while, so I can't test it out. Please ignore the following if this is not helpful. The code below was one of my experiments to create an animator. While it maybe working very well, it also was not worthed to add something as big inside of my resources, because of the size and feature count. But what it does is setting up parameters/arguments and adding animations to them. opacityStart = 0 opacityStart = 255 opacityStart = 0 So you might consider use it as inspiration to creating your own animator, smaller/bigger. (or copy this...) Uses https://forum.multitheftauto.com/topic/103866-enchantment-client-render-events-enchanting/
  15. Moved to resources, since it was a scripting request.
  16. If you are not are not (going to be) a programmer, then this is not the right section to post this. I will move your topic to resources, where you can request what you need. See also this section: https://forum.multitheftauto.com/forum/149-looking-for-staff/ Please read the guidelines of the scripting section:
  17. Did you add the download able assets(+ html) in to the meta.xml? (And check if those files are actually downloaded in the client folder) https://wiki.multitheftauto.com/wiki/CEF_Tutorial That is afaik serving files from serverside.
  18. Serverside is not complete at the very detail level of code instructions. Another script alone can't fill those unfinished parts.
  19. The resource/script is unfinished. You should ask the creator to finish it, finish it yourself or download a resource that is finished.
  20. function repair(_,state) if state == "down" then if isCursorOnElement(screenW * 0.5490, screenH * 0.4648, screenW * 0.6808, screenH * 0.5169) then if Kit_Reparo >= 1 then triggerEvent("startRepair", root) removeEventHandler("onClientRender", root, painelR) painel = false showCursor(false) else exports._infobox:addNotification("Você não possui kit de reparo!", "error") end end end end addEventHandler("onClientClick", root, repair) This addEventHandler is always attached and there is no validation that checks if the panel is open/button is visible.
  21. This rectangle exist out of 7 parts. - 4 corners - 1 big rectangle, the middle, from left to right - 2 small rectangles, top and bottom You can animate the big rectangle it's width and height. (+ Position, if not animated from left-top) The 2 small rectangles, their width and position. And the corners, their position. But make sure to align the components perfectly with the pixels on the screen. Half pixels might cause artifacts.
  22. Same here ? As far as I understand of the wiki. - You have group id's which are kind of slots you can use. I don't think you have to create them. Just use 1 for your first try. - Assign the object models you want to change to the group 1. - Then set the properties which you think you need to achieve your goal.
×
×
  • Create New...