[TUT] Creating AMXX modules (VS 2013 - 2019)
Hello, and welcome to this tutorial about creating AMX Mod X modules!
Althought there are many or few related tutorials, not many of them were reliable and simple. First of all, you should have Visual Studio installed. You should also be knowing the basics of C++. ---------------------------------------------------------------------------------------------------------------------------- Initializing - creating the module 1. Open the "New project" dialog, and create a Win32 C++ project. Make sure you chose the project to be empty.
Click to show
2. Change the "Configuration type" (Right click on project > Properties) to "Dynamic Library (.dll)".
Click to show
3. We're almost set. Now create a folder named "sdk" (recommended) and put the below files into it. 4. Open "moduleconfig.h" and give credentials to your module.
Click to show
---------------------------------------------------------------------------------------------------------------------------- Programming the module Writing beautiful code is a virtue. We'll (try to) do the exact same thing... :) 1. Create a header (.h) and source (.cpp) file. Both should have the same name. 2. Include the AMXX API ("amxxmodule.h"), and anything else that you need (i.e: 3rd-party libraries, MM, HLSDK etc.).
Click to show
3. A good way of keeping the module beautiful is by organizing the code well. So create a namespace with a proper name and declare functions (+ things you need), this goes into your header. PHP Code:
PHP Code:
1. If you keep getting an error specifying "_CRT_SECURE_NO_WARNINGS", open project properties and go to "C/C++" then "Preprocessor", and paste "_CRT_SECURE_NO_WARNINGS" in the first textbox ("Preprocessor definitions").
Click to show
2. The module (binary; ".dll" file) should have an "_amxx" suffix in order to work properly. You really don't need to name your project with it. If renaming the module over and over again (after compiling) seems tiring, then open project properties and head to "General" settings, and append "_amxx" to the "Target Name" textbox.
Click to show
3. Make sure you don't over-include the header. Code:
4. Prepare the module. Code:
5. Define the natives in your Pawn header. Code:
I have uploaded the source to my GitHub account. Check its repository here. So, in conclusion we have a fully working module. :) https://i.imgur.com/d27Vbrj.png Other references: - AMXX SDK & misc - Metamod & HL SDK I've possibly done many spelling mistakes or usen incorrect terms, so correcting me is appreciated. If you got any trouble or need help (regarding the same topic) then ask me here, I'll try my best to answer. |
Re: [TUT] Creating AMXX modules (The easiest way)
Quote:
|
Re: [TUT] Creating AMXX modules (The easiest way)
Quote:
|
Re: [TUT] Creating AMXX modules (The easiest way)
Hello friend, im really intersted to learn the amxx modules..
Im beginner in Pawn language im still learning I see here that the modules work better than anything? so if i want to make a module works with a plugin i just have to add only the natives in modules then the other parts on the plugin? |
Re: [TUT] Creating AMXX modules (The easiest way)
Quote:
|
Re: [TUT] Creating AMXX modules (The easiest way)
Like I said im still beginner n im sorry
What your advice to me should i first learn pawn until i become amxx scripter Then I going to make modules? |
Re: [TUT] Creating AMXX modules (The easiest way)
Quote:
Making modules is easy if you know C/C++ or/and content of the game, frankly it's 2019 and there are A LOT of sources to do that. |
Re: [TUT] Creating AMXX modules (The easiest way)
For Visual Studio 2019 there are few change and additional step you need to go though
If the image is too hard to see, click on it. ---------------------------------------------------------------------------------------------------------------------------- Quote:
Spoiler
---------------------------------------------------------------------------------------------------------------------------- Quote:
Spoiler
2. Go inside the folder you just create and make another folder name "sdk" there. 3. get 3 following files: "amxxmodule.cpp", "amxxmodule.h" and "moduleconfig.h" from AMXX SDK and patse it in "sdk" folder. (he didn't mention those files name from the original post) 4. Back to Visual Studio, Create new "filter/folder" name "sdk" (Right click on Project > Add > New Filter) 5. Add all 3 files that you pasted in the "sdk" folder at step 3 into the "sdk" folder inside Visual Studio (Right click on Project > Add > Add Existing Item... > (Browse those file) > Add) ---------------------------------------------------------------------------------------------------------------------------- Bonus++ If somehow you get some error like "cannot open source file "IGameConfigs.h", do this following step: 1. Open project property (Right click on project > Properties) and go to VC++ Directories, Include Directories then <Edit>. 2. Get AMXX master folder's directory (amxmodx-master\public\) 3. Go back to Visual Studio, Click on "New Line" (or Ctr+Insert) then paste the directory at step 2 there
Spoiler
4. Click OK then it would be finish |
Re: [TUT] Creating AMXX modules (The easiest way)
Thanks for the awesome details @Celena Luna! I had in mind to extend this thread for cross-platform purposes recently but unfortunately I didn't have much time.
|
Re: [TUT] Creating AMXX modules (VS 2013 - 2019)
Why didn't you include all of the prerequisites? Linking the external dependencies (hlsdk/metamod) to your project?
|
All times are GMT -4. The time now is 16:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.