Jump to content

The_GTA

Helpers
  • Posts

    822
  • Joined

  • Last visited

  • Days Won

    86

Everything posted by The_GTA

  1. Hello SrPeixoto, can you share more details about your issue? I am unable to understand what the specific issue that you are facing is. Please try posting a screenshot or other diagnostic messages that you find. Then we can try fixing the problem together! ?
  2. DX drawing does not result in elements. Instead of drawing things manually I whole-heartedly recommend you to use DGS instead. You have not entirely read my mentioned posts. I am not supporting this topic anymore.
  3. But what you are trying to do is not a simple task! Try to read the post I mentioned and research onClientClick event handlers. addEventHandler("onClientClick", root, function(button, state, screen_x, screen_y) outputChatBox("bla"); end );
  4. It does work, but you are still facing difficulties. I suggest you to open up another thread and mentioning me inside of it. Your case might deserve special attention.
  5. I am going to assume that you have basic Lua skills. Take a look at the following leads: dxDrawRectangle - Multi Theft Auto: Wiki UI layout basics text drawing details Edit box details custom scrollpane
  6. Hello MineX server, creating a custom UI layout system along with all the required layout math can be frustrating for beginners. By asking this question I am assuming that you have no prior experience with custom UI systems in general. For that reason I recommend you to use the DGS resource. It was created by renowned members ( @xLive and @thisdp) of the MTA community and is based on the dx family of drawing functions. How about you give it a try? ?
  7. I really like that you have quickly added a lot of debug feedback to your script! I am looking at things such as the drawAllocatedTable function and I am impressed with the progress of your resource. Some suggestions · Issue #3 · Fernando-A-Rocha/mta-add-models (github.com) Not checking the element-data key during onClientElementDataChange · Issue #2 · Fernando-A-Rocha/mta-add-models (github.com) Element models not released by destroyElement (issue?) · Issue #4 · Fernando-A-Rocha/mta-add-models (github.com)
  8. I like the idea of your resource! It acts as a scripting backend, hence the suffix "(library)", which allocates new real model IDs for your own virtual set of model IDs. There appears to be a requirement to a fixed set of models into the resource so that it can sync them to players. Found issues in version 1.1.0 if there are two peds synced for the player and both have the same custom model assigned to them, then if one of them streams out your syncer attempts to release the custom model for both of the ped elements, especially the one already streamed in. While the documentation of engineFreeModel does not mention what happens in this case, I assume that the request fails. This scenario is a potential model ID leak (the client will run out of available real model IDs at some point). Even worse: the client could run out of RAM very quickly. Here are my suggestions add a custom model cache based on usage frequency, API hinting (setCustomModelAlwaysLoaded) or database flag so that MTA does not have to perform the expensive disk loading of model data as frequently (improves FPS) add a way to register custom models from other storage resources. This way custom models could potentially be downloaded from the server on-demand by a second resource and - after finishing the download - be registered as custom model inside of your own resource. Could be really fun! add statistics API about the number of custom models loaded, their usage details (frequency, number of elements with the model, etc) and the general performance of the resource. You could even add a debug dashboard using some hidden key combination (very important to build user-trust into your resource workings) One issue and suggestions · Issue #1 · Fernando-A-Rocha/mta-add-models (github.com) Nice work so far! Keep it up.
  9. Hello Mario222, can you open up your admin panel and see whether the race_scoringsystem resource does have a "race_opponentrank" setting assigned to it? If the setting is missing then this error could be happening. Please post a screenshot of the available settings of said resource.
  10. Hello FR0314, how about you try changing... ... local message = table.concat( {...}, " " ) outputDebugString ( ... , 1) ... to... ... local message = table.concat( {...}, " " ) outputDebugString ( message , 1) ... Even if help is no longer needed, it will help other people.
  11. Look here for steps which were made in combination with the scene2res tool. Should work for a lot of custom model maps which come with scripted custom models.
  12. @SrPeixotoTake a look at my steps that I wrote down over here. They are made for a similar tool but should work for you.
  13. I happened to know Remi-X back in the day and was in frequent contact with him. Now that he has moved on to web development he no longer maintains his MTA efforts, including modloader. The resource you are trying to use was not designed for object model replacements. But you can mis-use the resource by placing an object model as vehicle model instead. A clean adjustment of the resource logic would be more fitting into the Scripting forum instead. If you are looking for a more generic-sounding model loader for your cause, try this one instead.
  14. ... or you can remove the first parameter from the otur2 event handler called "player" and use the global event variable source instead, since you are already passing that as second argument to the triggerServerEvent function from inside the mouse2 function.
  15. Hello oblivionosaka, could you tell us what modloader you are talking you? Is it this old resource by Remi-X? Since you are talking about a specific modloader please point us to it.
  16. Dear MTA support, I have been looking at the player lists of the most popular MTA servers and have stumbled upon a peculiar player list issue. By looking at the player list it looks like the servers do report empty player names. I am not aware of any method to hide player names from being reported in the server browser so I concluded that they report more players than they actually have playing on them. Please take a look at the following excerpt from Iran-MTA: There are servers inbetween empty-playername servers that do not have empty playernames in their player list. Is my assumption correct that servers use this method to virtually increase their player count? Or is there any other explanation for this issue? Knowing the answer to this is important for an understanding about the authenticity of MTA servers, especially the player count as displayed on the top of this webpage.
  17. This opens up another dimension of MTA impact: the possible shift of focus - official MTA contributor's that it - away from MTA to this new MP project. While I do see many junction points between MTA and this new one, I hope that MTA will keep getting updates very long into the future, too! Just read the post from that guy above who possibly presented the potato PC argument. While I did hastily judge his argument, after longer consideration, I am not in the position to do it. Let's pray for the best!
  18. I have seen TXD files inside of the GTA Trilogy San Andreas packaged files. While you cannot buy the game for PC at the time, it does look promising. The UE file formats seem to be understandable aswell, but I just don't have the time yet to create tools for them, etc. First I want to work on the Lua compiler and am hoping that the Trilogy MP will support Lua aswell. All of the Lua scripters should have it easy to find their way onto those beautiful and new remasters/remakes!
  19. You're welcome, friend! I really enjoy people like you who are willing to go on this difficult journey to learn programming. May you have a good future inside of the MTA community!
  20. The easiest and recommended way to check for validity of the theVehicle variable is to ask the Lua runtime whether theVehicle is not nil and not false. You can do that with a simple if-condition where the condition consists of the variable only. Like this: ... local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) if (theVehicle) then local vehType = getVehicleType(theVehicle) -- Warning is Here ... This check is sufficient due to the documentation of the getPedOccupiedVehicle function. It says that it returns false only if the player is not inside of a vehicle. Else it returns a vehicle element which is never false and never nil. Don't worry about yourself. You seem to be progressing in the right direction. ?
  21. Have you downloaded the traffic resource from MTA community? Take a look into it. It has got the things you need.
  22. Hello syn0nym, at the Wiki documentation of the onClientPlayerJoin event it tells you that it does not trigger for the local player. I suggest you to use the onClientResourceStart event instead with the resourceRoot as base-element.
  23. You should be able to solve the first part of the question by yourself using the same approach that you used for the player but now based on the player's vehicle. To implement the second part you need to know about safe coordinates for vehicle placement that are not inside water and connect that to the first part of the question using the setElementPosition function. Since MTA by default does not provide you with a function to retrieve recommended land positions I suggest you to try taking the traffic path nodes from the MTA community traffic resource. The path node definitions are located in the definitions folder. The most interesting function inside of the resource is the following (traffic_common.lua): function pathsNodeFindClosest ( x, y, z ) local areaID = getAreaFromPos ( x, y, z ) local minDist, minNode local nodeX, nodeY, dist -- for id,node in pairs( AREA_PATHS[areaID] ) do for id,node in pairs( AREA_PATHS_ALL[areaID].veh ) do nodeX, nodeY = node.x, node.y dist = (x - nodeX)*(x - nodeX) + (y - nodeY)*(y - nodeY) if not minDist or dist < minDist then minDist = dist minNode = node end end return minNode end It is a pretty icky mathematical solution to your problem because this function does not return a point on the path lines but just the points that are stored in the database as start and end points of lines, but it is better than having nothing! Use this function by passing the vehicle position inside of the water to it and it will return a node object with fields x, y, and z. You will have to find a ground position based on the point above ground (for ex. the node x, y and z). I suggest you use the getGroundPosition function. A popular candidate for calculating the ground-offset of vehicles is the getElementDistanceFromCentreOfMassToBaseOfModel function. Just add this distance to the ground z coordinate and you should obtain a good vehicle placement position based on the 0, 0, 0 euler rotation. You will have to slice parts of the resource away and put them into your own because there are no exported functions for the traffic resource. Have fun!
  24. Hello Rafax7, I suggest you to look at the following MTA functionality: onMarkerHit event createMarker function hasObjectPermissionTo function setVehicleDamageProof function setElementData / getElementData functions addCommandHandler function getPedOccupiedVehicle function First create a marker on the game world (createMarker could help). Then assign an event handler to the onMarkerHit event with the marker as base-element. Inside of said event handler check if the hitElement argument is a player element. If the hitElement is a player then perform a check using hasObjectPermissionTo on the hitElement for the "vehicleShield" permission. If both checks were successful, then set the element data "applicableVehicleShield" of the hitElement to true. After the event handler registration we put a command-handler for the "vehshield" command. Inside of that command-handler we check that the player who typed that command has the "applicableVehicleShield" element data set to true. Then we get the vehicle of the player. If there is a vehicle then we set it damage proof. It is possible to armor the car if the player enters a car after hitting the marker. It could be possible to armor the car where the player is not the driver. It is possible that allowances for vehicle damage proof applications carry-over across resource stop-and-start. Preventing these scenarios would require additional checks (exercise left for the reader). Good luck! ?
×
×
  • Create New...