How to compile a sma-file and how to handle i

Started by SchlumPF
14/06/2008 01:04
Page 1 of 1
SchlumPF14/06/2008 01:04(edited 27/02/2009 18:30)

How to compile sma-files, what are they used for?

What is a sma-file used for?
A sma-file is basicly the sourcecode of an AMXX plugin. You can change parts, or if you are not fimilar with "pawn", the programming language AMXX uses, just edit text messages the plugin sends on certain events.
All published AMXX plugins need to include the sma-file, since AMXX was released under GNU license agreement. This makes it a freeware "tool" and it's sourcecode is available for everyone. Plugins published without the sma-file will be blacklisted, which means that you cannot use these plugins any longer.

What is "compiling"?
During the compiling-process a file will be created, that once it's done, is readable for AMXX. You will need to compile your plugin's sma-file again after every change you made to see the effect and if it uses any costum functions with are not included in AMXX itself.

How should I handle inc-files?
Most programming languages require to tell the application from where it should read the commands which are used. Telling the program these files is called including (inc = include). Pawn is one of these languages. The compiler which comes along with AMXX already includes common inc-files but you may need to add costum inc-files like the colorchat.inc of LjStats. To do this simply paste the inc-file in the include-folder in your compiler-folder.

How to compile?
There are basicly two ways of compiling a sma-file.
The first method, which will only work if your plugin doesn't require any costum modules or functions, is to use this webcompiler. At the moment it is not updated to AMXX 1.8 files, so you cannot compile any plugins requiring the new functions or the HamSandwich module of AMXX 1.8. Therefore you can use this webcompiler, which is even able to compile with different builds of the compiling tool. I will not explain any of those webcompiler since it is selfexplaining.
The second and better method is compiling localy, which means that you compile the sma with an application on your harddisk. First of all you will need to download the latest AMXX here. After you have unpacked the AMXX-files you will see a folder called scripting. This folder includes the sourcefiles (sma-files) of AMXX plugins and the compiler. Its subfolder "include" contains all functions. You will need to put all inc-files you need for a plugin in this folder, because the compiler will try to find the neccesary information for functions there. Your sma-file goes in the scripting-folder. All you need to do now is doubleclick "compile.exe" to start the process. If it hasn't already been done, a folder called "compiled" will be created. It contains all your compiled sma-files, which are now amxx-files and ready to go.

How to decompile?
For decompiling you may use this tutorial by BAILOPAN.

Links
Latest AMXX version
AMXX webcompiler
AK-Team webcompiler
Decompiling tutorial

SchlumPF30/06/2008 06:46

will add that url after school in the mainpost ;D

ZacI30/06/2008 08:10

what about .amxx compiler amxx->sma???

SchlumPF30/06/2008 23:20

updated
-added a link to a better webcompiler which supports amxx 1.8 also
-added a link to a decompiling tutorial (amxx -> sma)

Lt.RAT02/09/2008 23:34(edited 03/09/2008 00:01)

Anyone have latest AmxReader for decompiling plugins...
Cannot dl it from official http://wraith.techcore.org/amxreader/ site :( mb dns problems mb :(

Edit:
so, the 2.0.2117 i found here: http://forums.alliedmods.net/attachment.php?attachmentid=23544&d=1202595929
but this one wont open one of the needed amxx files :(

SchlumPF27/02/2009 18:32

updated
- added the section "How should I handle inc-files?"

Page 1 of 1

Please log in to post replies.