Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 14/10/23 in all areas

  1. Developers should understand the importance of using string methods because this way you can ensure readability and bruthe force free lines of code
    1 point
  2. yes actually we can use some math methods in this, here I will show an example -- The function rounds up a number and then truncates the decimal places. function roundUpAndTruncate(number) -- Round number up local roundedNumber = math.ceil(number) -- The whole number (before truncating the decimal places) local integerPart = math.floor(roundedNumber) return integerPart end -- For example local number1 = 232.98266601563 local number2 = 232.49445450000 local number3 = 232.50000000000 local result1 = roundUpAndTruncate(number1) local result2 = roundUpAndTruncate(number2) local result3 = roundUpAndTruncate(number3) print("Case 1 - Result: " .. result1) print("Case 2 - Result: " .. result2) print("Case 3 - Result: " .. result3)
    1 point
  3. string.format should definitely be more used in MTA scripts. I see people doing string concatenation all over the place. It often creates long and confusing code lines, especially when you involve if conditions. Using string.format would make the code more readable. Good guide!
    1 point
  4. Hi all! Today MTA:SA Developers: Mobile version 3.0.1 was released for testing! Thank you very much all who took part in the first testing, during which some bugs were identified and fixed of today's release! In addition, new features have appeared in the application: Added syntax highlighting in Wiki code blocks Added copying and importing code from Wiki to the code editor Fixed FPS drop when scrolling HTML and XML code in the code editor Added a standard name when creating a file from the code editor Added saving of opened file in the file manager Added synchronization with the physical keyboard in the code editor, hotkeys: CTRL + LEFT (move the caret to the beginning of the line) CTRL + RIGHT (move the caret to the end of the line) ALT + LEFT (caret shift to previous word) ALT + RIGHT (caret shift to next word) CTRL + Z (undo) CTRL + Y (redo) CTRL + S (save file) CTRL + D (clear code editor) ALT + M (open code editor menu) ALT + DOWN (hide tabs) ALT + UP (show tabs) The link to participate in testing the new version of the application is the same: https://play.google.com/apps/testing/ru.limedev.mtacse
    1 point
×
×
  • Create New...