Jump to content

How to use library in MTA?


Quiz

Recommended Posts

Posted

Hi guys, I just want to ask about how to install lua libraries( ex: Socket Library ) in MTA to be able to use thier functions?

Posted

Copy the library (DLL) to the 'modules' folder located in %PATH_TO_YOUR_SERVER%/mods/deathmatch/. Then, open the file "mtaserver.conf" file located in the same folder above (%PATH_TO_YOUR_SERVER%/mods/deathmatch/) and search for module node and add the following line below them but changing the name of the DLL in this to the right one:

<module src="myModule.so" /> <!-- Change "myModule" to the name of the DLL. This loads a "myModule" shared library in the server, but only for Linux. If you're using Windows, you obviously need to change the extension 'so' to 'dll' in this line --> 

Posted

I really don't know much in these stuff, but what I know that I have to use require() to load the library but in debugscript 3 says that it's not safe. Do you have any idea what should I do now?

Posted

As I said in one of the previous topic, MTA does not allow using 3rd party libraries for security reasons therefore you can't use any Lua libraries.

Posted

Ah, ok.. Now I got it. I thought that by "Lua libraries" you meant "modules", Quiz.

By the way, there is a sockets module (there are actually two I think) that you can use. Simply download it from the MTA:SA Wiki and follow the steps I wrote above.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...