Jump to content

The_GTA

Helpers
  • Posts

    822
  • Joined

  • Last visited

  • Days Won

    86

Everything posted by The_GTA

  1. Dear MTA forums administration, there appears to be a fair amount of users on our forums that auto-translate all of the content on this web-page. Support topics start with the impression that they are awkwardly-speaking-but-trying English speakers but in replies the quotes turn out to be Spanish, Polish, etc giving away that they actually auto-translate everything. There are people who do not know about this problem because they just set the auto-translator for everything English. Those people suffer from issues of understanding, essentially because the auto-translator botches-up the original writing. I suggest that users should have the ability to decide whether their forums posts should be posted using auto-translation disabled on the HTML elements. This can be done using the HTML translate attribute on div tags. I suggest that there be a new option in the user's preferences to put this attribute on all of their posts by default. Then you should be able to decide on an individual post's basis if auto-translation should be allowed. Please think about the future of our forums. ?
  2. Let me try to give you the necessary portion of the page which is important to you. Can you understand reading this English portion of the page? I suggest you to start the "runcode" resource and typing run string.find("abcd", "[bc][bc]") in your server console. Lua patterns are really nice.
  3. Hello, please take a look at the Lua Patterns tutorial page. There you can learn how to match a character-class, a set of distinct characters that you want. You can also find ways to detect a repetition of your characters.
  4. What is this... triggerServerEvent("resourceCheck", resourceRoot) engineRestoreModel(1) engineRestoreModel(2) outputDebugString("false", 4, 255, 0, 0) setTimer(privateKey, 1000, 0) ... and most importantly, this? setTimer(privateKey, 1000, 0) You could try perfoming a full garbage collection cycle to clean up Lua string memory. engineImportTXD(engineLoadTXD(decodeSource('models/' .. path .. '.txd', passwordHash)), model) engineReplaceModel(engineLoadDFF(decodeSource('models/' .. path .. '.dff', passwordHash)), model) collectgarbage() But I think that the root cause of your problem is that you are loading in too many MTA server DFFs and TXDs into the game instead of only loading what is necessary.
  5. I think that M.Wizard has also asked to have the text be vertically below ("under") the previous text. In that case you have to extend your example with a query to the guiGetText function along with a string concatenation. Instead of replacing the memo text we should append it, like so... (...) for i=1,#message do local prevText = guiGetText(myMemo) local newText = message[i].name if (prevText == "") then guiSetText(myMemo,newText) else guiSetText(myMemo,prevText .. "\n" .. newText) end end
  6. Try... setWaterLevel(-1000, true, false, true, false)
  7. You could try modifying the vertex diffuse colors of the ped model so that you embed a "morph weight" for each vertex into the alpha channel. This would require modification of the ped model file. I am not sure how RenderWare does treat those ped colors. Then you can read the alpha channel value in the morph vertex shader. If the alpha channel is zero, then no morphing is performed on the vertex. Otherwise you can scale the morphing by ( alpha * GLOBAL_MORPH_SCALE ) where alpha is color value inside of the shader ranging from 0 (no opacity) to 1 (full opacity). Try setting the alpha channel values for body parts that you do not want to be morphed to zero. Then apply a non-zero alpha channel value to body part vertices that you do want morphed. Inside of the shader pass 1 as real alpha value to the pixel shader. I don't think that peds use alpha values in vertex colors anyway.
  8. You could be seeing a GTA:SA default world water placement. You cannot delete such water placements. Instead of removing you can try using the setWaterLevel function to hide this water. Try setting the water level to -1000.
  9. I am interested in the mathematics behind ped "skinning". I know that a ped skin is defined as a map, where vertices are keys and a set of bones with a weight-number are the values. From what I'd imagine the weight-number should be a value between 0..1, the sum of all the weight-numbers for a single vertex should equal 1. So is my assumption correct that the skinned position of each vertex is the sum of all relative-to-bone positions of each vertex multiplied with the corresponding vertex bone-weight? (weight = 0 for no weight of a bone) We need to get this definition straight so that the mathematics can be correctly applied in the vertex shader!
  10. What is your definition of "dying" if applied to a script?
  11. Please take a look at the lua-users.org Patterns tutorial page. If you want to match for only the string of 'abc' characters then you can do... local beg, term = utf8.find("aaaaabbbbbcccc", "[abc]*");
  12. Why don't you just wait for the server-event anyway? You should replace the skins once the access-grant event has been triggered on the client. You could use the resource-start event for triggering the permission-request-event to the server. Also remove those timers because they make no sense. addEventHandler("accessGranted", resourceRoot, function() engineRestoreModel(1) engineRestoreModel(2) loadMod(...) loadMod(...) end) You should grant the access to only one client. Currently you are triggering the event for every client on the server which is wrong: ... triggerClientEvent(client, "accessGranted", resourceRoot) ...
  13. local is_hit, hitX, hitY, hitZ = processLineOfSight( 0, 0, 5000, 0, 0, -30, true, false, false, true, true, false, false, false, nil, false, false ) if (is_hit) then outputDebugString( "hitZ: " .. hitZ ) end
  14. Hello iwalidza, use the processLineOfSight function manually and pass the "checkObjects" parameter as true. Basically, you should check a vertical line from the sky down to the limit of the internal GTA:SA player reset height. The game does it anyway and getGroundPosition is provided just for convenience.
  15. You have to receive such information from the server using custom events.
  16. Hello Egor_Varaksa, I suggest you try playing around with the onClientGUIChanged event. Use the guiGetText function to fetch the current content of the editbox. If the current text contains any invalid characters then reset it to the previous text. You should try using the utf8.find function to check for validity of the text. Basically, if the entire content matches against your pattern (start index = 1, end index = #content) then it does match your language requirements.
  17. This MTA module is about total filesystem access to your MTA server. You can find it's documentation here. It supports the Windows and Linux operating systems, each with different and specialized details (path handling, OS calls, etc). Contains many neat features such as memory-mapped files, stream copy helpers, direct binary-encoded writing and reading API, etc. The module has got a very long history (used in Scene2Res, Magic.TXD). It is very strongly unit tested. If you like this module then you can use it's C++ API for even greater freedom. Current version: 2.0 Source code location (Module-specific): Source Tree: blueMods/fileSystem/ (head) - green-candy (svn) - green-candy - OSDN Source code location (C++ Library): Source Tree: FileSystem/ (head) - eirfs (svn) - Eir FileSystem - OSDN Download (Win32): https://green-candy.osdn.jp/external/releases/fileSystem_2_0_win32.zip Download (Linux): https://green-candy.osdn.jp/external/releases/fileSystem_2_0_linux.zip
  18. Hello iwalidza, you need to first think of a mesh model for the 3D geometry. Then you need to have an idea about the algorithm that would approximate your terrain. Finally you have to write a RW DFF output layer. I do not recommend you to use MTA Lua for this task. You should off-load this task to a specialized application and then create databases of this terrain for use by MTA.
  19. The_GTA

    drop item

    Hello iwalidza, to modify the physical properties of object models you could try playing around with the engineSetObjectGroupPhysicalProperty and engineSetModelPhysicalPropertiesGroup functions. In order to pick-up objects from the ground you might devise some logic based on the distance between the object and the players, based on the press of an input.
  20. Sounds like you want to use this MTA library resource: How about you try creating a script that uses this resource by @FernandoMTA?
  21. I wonder, since you plan to download the textures to your MTA server anyway, why do you not host your own image upload server on the same machine as your MTA server aswell? I know that it can be a hassle to upload files through MTA, especially if the users have to visit the MTA folder and put files there. But you can then place files that you download in a folder that MTA would look into, basically maintain the database in coordination with both the upload server and the MTA server. This GitHub issue could be of interest to you: A way to upload files to a server · Issue #2489 · multitheftauto/mtasa-blue (github.com)
  22. If you get the error-code 1 then it is translated to the following internal error descriptor: CURLE_UNSUPPORTED_PROTOCOL It looks like MTA does not support connecting to the web-service that you have specified. I am judging this according to the official MTA documentation. This is a shame, really. I wonder if you could get competent help if you did post your inquiry on the MTA:SA GitHub issue tracker? Web-technology is really complicated and, as you see by this example, it is likely to find situations of incompatibility. Hint: it is important to prefix the URL you pass into fetchRemote with either "http://" (not encrypted) or "https://" (encrypted). Else you are violating the spec. Good luck!
  23. Each sub-table inside of the table stored inside the desc variable has four key-value pairs after script execution, for example: [1] = "skin", [2] = "Base Skin", ["label"] = gui-label, ["edit"] = gui-edit. You can obtain a single such gui-edit by... desc[1].edit ... or you can loop through the desc table using an for-each ipairs loop and then do as eoL|Shady has suggested.
  24. Sure, I think it is helpful to take a look at the MTA wiki's illustration of the pType parameter for said function: In this image you see the way that the points which you pass into the function are connected to shapes. The incremental set of numbers corresponds to the order in which you pass the points into the function. Vertex is just another word for a point. I am puzzled about the exact capacity of your question. Is there still anything that is unclear to you about the function's operation? It could be helpful to ask further specific questions. I do acknowledge that you appear to lack a certain capacity about visual to mathematical model translation.
  25. Hello MTA.Castiel, you are missing a call to killTimer inside of your custom "resetTimer" function to clean up the possibly running timer, like so... function resetTimer() if (repairTimer) then killTimer(repairTimer) repairTimer = false end end Also, please refrain from overwriting official MTA functions with your own ones.
×
×
  • Create New...