mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-27 07:15:37 +03:00
35 lines
1.4 KiB
Plaintext
35 lines
1.4 KiB
Plaintext
**** HOWTO MAKE A MODULE ****
|
|
* STEP 1
|
|
Download the AMXX Sdk, and place all files into your module source dir.
|
|
Don't edit amxxmodule.h or amxxmodule.cpp
|
|
Rename moduleconfig.in.h to moduleconfig.h
|
|
|
|
Go through the moduleconfig.h file and do what it says
|
|
If you want to have natives in your module, uncomment line 30
|
|
( // #define FN_AMXX_ATTACH OnAmxxAttach )
|
|
If you want to have forwards in your module, uncomment line 35
|
|
( // #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded )
|
|
If you want your module to use metamod, uncomment line 22
|
|
( // #define USE_METAMOD ) and set up metamod hooks (starting an line 54)
|
|
You only have to uncomment the line (you may change the function name if you want to).
|
|
* STEP 2
|
|
Add an another source file.
|
|
At the beginning, add the short GPL and
|
|
#include "amxxmodule.h"
|
|
If you have uncommented any hooks in moduleconfig.h (metamod hooks or Metamod init functions or amxx init functions),
|
|
define the functions here (or you will get unresolved externals).
|
|
If you want native functions, add a call to MF_AddNatives into the OnAmxxAttach function.
|
|
If you want forward functions add (a) call(s) to MF_RegisterForward into the OnPluginsLoaded function.
|
|
* NOTES
|
|
Include files order in your cpp file(s):
|
|
standard files
|
|
amxxmodule.h
|
|
your files
|
|
Example:
|
|
#include <stdlib.h>
|
|
#include <string>
|
|
#include <stdio.h>
|
|
|
|
#include "amxxmodule.h"
|
|
|
|
#include "mymoduleutils.h" |