Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by IIYAMA

  1. The server root is at the place where the server launcher is: MTA Server(.exe) You could rename the folder which contains the launcher, to your server name: Program Files (x86)\MTA San Andreas 1.5\server\mods\deathmatch Renaming folders deeper does not make any sense, because that is not the container of your server. > If there is for example a tree in front of you, and a leaf nearly falls off. Would you start calling that leaf also a tree?
  2. MTA locates it's files based on folder names, if you change the folder name, MTA can't find them. Why do you want to change it?
  3. You can also use this selector if you want all columns from a specific table: jobs_sys.* But it could override some of the table values, if the names are the same from the 2+ tables.
  4. The alignment of the tables have to be defined. Try this: SELECT jobs_sys.uid, jobs_sys.x, jobs_sys.y, jobs_sys.z, jobs.money FROM jobs_sys LEFT JOIN jobs ON jobs_sys.uid = jobs.uid
  5. Do a left (table) join. https://www.w3schools.com/sql/sql_join_left.asp This is the default way data get aligned and merged from different tables.
  6. As long as you work with hashed passwords and not just encryption (decryption serverside), it should be fine. Working with real passwords (even when encrypted) is the reason why it shouldn't be done. When the 'remember me' is checked, the password field should be disabled and not be filled in. (or even the form shouldn't be showed)
  7. An example: local scale = interpolateBetween(0.7, 0, 0, 0, 0, 0, progress, "OutQuad") local width, height = dxGetTextWidth(getPlayerName(v),scaleF,settings.font,true), 2*scale local imageSize = 40 * scale local offset = 40 * scale local sx, sy = sx - (width / 2 + imageSize + offset), sy-height dxDrawImage(sx, sy, imageSize, imageSize, "files/typing.png",0,0,0,tocolor(255,181,64,255)) -- no imageSize since the image is drawn from left to right local sx, sy = sx + (width / 2 + offset), sy-height dxDrawImage(sx, sy, imageSize, imageSize, "files/typing.png",0,0,0,tocolor(255,181,64,
  8. Normally you would calculate the position like this: -- The width local textWidth = dxGetTextWidth(getPlayerName(v),scaleF,settings.font,true) local offset = scale * 50 -- Offset from the text -- Note: The text is centered!!! local positionX -- Before positionX = positionX - (textWidth / 2 + offset) -- After positionX = positionX + (textWidth / 2 + offset)
  9. What about dxGetTextWidth(getPlayerName(v), 1,settings.font,true) + 270 * scale -- or if the font is scaled: dxGetTextWidth(getPlayerName(v), scale,settings.font,true) + 270 * scale for the width.
  10. I am also using triggerClientEvent for the rotations. But not because of this issue, it is more for combining all AI instructions in to 1 packet and therefore reducing data. While rewriting your code, you might take that concept in consideration.
  11. Not sure what the best approach is. Kashtesov released a function that allows you to get the ground position serverside of the GTA san world. But it would be probably better for your user case: 1. Send triggerClientEvent 2. Draw lines at the place where you want to place the vehicle and check for any collision. https://wiki.multitheftauto.com/wiki/IsLineOfSightClear 3. Then confirm if there is any space: triggerServerEvent That way you also take custom objects in account. Or you can also combine those methods. Good luck!
  12. Try this local myFunctions = { ["FUNCTION_1"] = function (...) return exports.myresource:myFunction(...) end } Predefining export functions from another resource is not a good idea. Because when restarting that resource, all export functions will be reset.
  13. You should first check if the table exist. If not, fill in the blanks. local blankValue = "-" local c1, c2, c3, c4 = blankValue, blankValue, blankValue, blankValue local speedData = vehicleSpeeds[carID] if speedData then c1, c2, c3, c4 = unpack(speedData) end guiSetText(cLbl[1], "Stoke. speed: "..c1.." km/h.") guiSetText(cLbl[2], "Max. speed: "..c2.." km/h.") guiSetText(cLbl[3], "Acceleration 0-100 for "..c3.." s.") guiSetText(cLbl[4], "Drive unit: "..c4..".")
  14. nope, didn't think about that. But since you can draw on top of the chat, it is still worth a try. Or just draw it double, but bigger.
  15. Maybe you can draw something on top of it. *edited* https://wiki.multitheftauto.com/wiki/OnClientPlayerNetworkStatus
  16. Locked, requested by the creator.
  17. Server Client The key (server) "Level" is not the same as (client) "player:level". So there is your mismatch.
  18. I don't think that would be an issue. You can always optimise it later if it doesn't work as intended: Use multiple files instead. Or downloading only the ones of the peds in range. You can compile the file, (without obfuscation!), to speed up the downloading and loading time of the file. https://luac.mtasa.com/
  19. IIYAMA


    If you want to know that, then I recommend to take a closer look at the community resources (inspiration). https://community.multitheftauto.com/index.php?p=resources&s=list&name=&descr=inventory&category=
  20. The more entities it finds, the more performance it cost. (!!!especially if you loop over them) 1. A way to improve performance could be done by only get the streamed in players. getElementsByType("player", root, true) For example if you are drawing name-tags on players, you want to draw them only on players close by. By pre narrowing down the segment of players, this will reduce the amount of loops you are going to preform. for key, player in ipairs(getElementsByType("player", root, true)) do 2. And switching to a more basic loop c
  21. You can combine the tables first with for example this method table.merge. (make sure to copy the code) And then loop through them. Keep in mind that the table.merge method is mutating the first table. (mutating = changing the content of the table, instead of returning a new one) table1 = {1,2,3} table2 = {4,5,6} ---- local newTable = {} table.merge(newTable, table1, table2) -- or with table names table.merge(newTable, {"table1"}, table1, {"table2"}, table2)
  22. I am not sure why you would invent a new format for your data. You can just use JSON, supported by PHP, JavaScript, Nodejs and even MTA. local vehicles = { {model = 411, slot = 1}, {model = 562, slot = 2}, {model = 562, slot = 3}, } local dataString = toJSON(vehicles) -- text -- https://wiki.multitheftauto.com/wiki/ToJSON -- https://wiki.multitheftauto.com/wiki/FromJSON Normally I wouldn't use JSON for my vehicles, since you want MySQL to take care of that by having a separated vehicle table. Which allows me to fire MySQL queries to find the data, instead of having Lua parsing th
  23. The easing? -- The first 7 of this table are used: local strEasingTypes = { "Linear", "InQuad", "OutQuad", "InOutQuad", "OutInQuad", "InElastic", "OutElastic", "InOutElastic", "OutInElastic", "InBack", "OutBack", "InOutBack", "OutInBack", "InBounce", "OutBounce", "InOutBounce", "OutInBounce", "SineCurve", "CosineCurve" } local images = math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), 1) local move = interpolateBetween(3, 0, 0, -06, 0, 0, ((getTickCount() - startTicking) / 5000), strEasingTypes[images])
  24. An example of a nice and simple way to add 'time driven' animations to your MTA creations.


  25. Not random, but it does it's thing. 14000 / 7 = 2000 ms each image. local images = math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), 1) getTickCount() % 14000 This gives you a value between 0 and 13999 in milliseconds. This value counts up, resets and counts up again. (getTickCount() % 14000) / 14000) Value between 0 and 0.999999999. 7 * ((getTickCount() % 14000) / 14000) Value between 0 and 6.9999999 math.ceil(7 * ((getTickCount() % 14000) / 14000)) Value between 0 and 7. (very small chance that the value is 0)
  • Create New...