Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/08/22 in all areas

  1. MTASA Typescript I am developing utility packages for transpiling TypeScript into an MTASA-compatible Lua code. I would like to share that project to receive some suggestions and, I believe, to help someone in resource writing. Why Lua is not so good Classes. Lua does not support classes (syntax) from scratch. If you want to write OOP code with your own classes, you have to use metatables to implement class objects behavior. That's make the source code more complicated, than it could be. Hints (from your IDE). Lua is dynamic typed language, therefore, it's hard to determine, what the variable is and, hence, IDE cannot hint you function declarations, object methods and etc. MTASA Lua is still 5.1 (it is not developing). Lua, like any programming language, is developing, however MTASA core strongly linked to Lua 5.1. Why TypeScript There is TypeScriptToLua project. My project is based on TypeScriptToLua (I use it as a dependency). General purpose of TypeScriptToLua: convert (transpile) typescript code into Lua code. Thus, you can use TypeScript without modifying MTASA core. You are available to not use types in some parts of code (you are not restricted to use types everywhere). The TypeScript is being developed by Microsoft and, I believe, that TypeScript will be alive for several years. When to not use TypeScript (where to use Lua instead of TypeScript) 1. If you are not familiar with Lua or with scripting in general. 2. if you are writing simple script. Introduction Video I have made the video, where I describe Lua disadvantages, explain, why I have chosen TypeScript (and language transpiling) and write an example. Few word about mtasa-lua-types I have created this package to provide MTASA declarations in TypeScript. If you would like to create a resource, you haven't to install it manually, just use the boilerplate. Quick Start I have provided the tutorial here: https://github.com/mtasa-typescript/resource-boilerplate. So, you have to install NodeJS and download my boilerplate. And,... you are ready to code. If you have any ideas, issues or suggestions -- post them below, or in youtube comments, or in github issues ? Example code (from youtube video) import { Player } from 'mtasa-lua-types/types/mtasa/server/oop/Player'; import { mtasa } from 'mtasa-lua-types/types/mtasa/server'; interface GithubCommitApiResponse { commit: { message: string; } } mtasa.addCommandHandler('getcommit', function(player: Player, cmd: string) { mtasa.fetchRemote( 'https://api.github.com/repos/mtasa-typescript/mtasa-lua-types/commits?per_page=1', (data: string) => { const json = mtasa.fromJSON(data) as GithubCommitApiResponse mtasa.outputConsole(`The last commit message: ${json.commit.message}`) } ) }) Future plans - Github bot, that will crawl mtasa wiki and update mtasa-lua-types continuously - Add better hinting for `addEventHandler` function Links WebSite: https://mtasa-typescript.github.io/ GitHub MTASA TypeScript Projects: https://github.com/mtasa-typescript Resource Boilerplate: https://github.com/mtasa-typescript/resource-boilerplate Resource Example: https://github.com/mtasa-typescript/resource-example
    1 point
  2. I can't really say I'm an expert either, but improving your device specs will obviously have a positive overall impact on your performance. As I stated previously, this is not mandatory if the perfomance drop you experience happens only on one specific server - this has to do more with how that server is configured/optimized and how heavy-modded it is, rather your specs being the problem.
    1 point
  3. Sorry, this was a mistake on our end and has been removed
    1 point
  4. قوانین انجمن فارسی ام تی ای:اس ای .به انجمن فارسی ام تی ای خوش آمدید. لطفا قوانین زیر را جهت اطمینان مطالعه نمایید نسخه کوتاه لطفا با قضاوت صحیح از هرگونه اعمالی که باعث دردسر برای ما و شما شود خودداری نمایید. ضمنا بایکدیگر بدرستی برخورد نمایید نحوه تماس با ما سرور دیسکورد: (در صورت هرگونه سوال): مشخصات - لینک دعوت پیام در انجمن (پی ام - الالخصوص برای موضوعات خصوصی): لینک اعضاء توییتر : ام تی ای گروه استیم : لینک قوانین کلی الف) از هرگونه بی احترامی و برخورد نادرست خودداری نمایید ب) قوانین عمومی را رعایت نموده و از فحاشی، نژادپرستی، مباحث سیاسی و مذهبی خودداری نمایید پ) انتشار هرگونه لینک دعوت، تبلیغ و غیره خودداری نمایید ت) از انتشار هرگونه اطلاعات شخصی دیگر افراد خودداری نمایید ث) هرگونه انتشار و استفاده و یا درخواست کمک برای اسکریپت های لو رفته یا دزدی شده اکیدا ممنوع است ج) لطفا از استفاده حروف انگلیسی (به اصطلاح فینگلیش) خودداری نمایید
    1 point
×
×
  • Create New...