This repository has been archived by the owner on Dec 24, 2023. It is now read-only.
forked from LevShisterov/BugfixedHL
-
Notifications
You must be signed in to change notification settings - Fork 5
Server API
tmp64 edited this page Jan 6, 2021
·
2 revisions
The server exposes IBugfixedServer interface for Metamod plugins and there is also an AMX Mod X module that adds C++ API natives to AMXX.
C++ header and AMXX include are well-documented and can be found here (C++) or here (AMXX).
To use the API in your Metamod module you need to do the following:
- Copy IBugfixedServer.h from [repo dir]/bugfixedapi.
- Copy interface.h, interface.cpp and enum_utils.h from [repo dir]/common.
- Copy CGameVersion.h, CGameVersion.cpp and ClientSupportsFlags.h from [repo dir]/game_shared.
- Copy (those are the last files, I promise) bhl_api.h and bhl_api.cpp from *[repo dir]/bugfixedapi_amxx.
- Include bhl_api.h in the main file of your module.
- Call
InitServerApi()
fromvoid OnAmxxAttach()
. This function returnsE_ApiInitResult
. Check bhl_api.h for details.
The API can be used using serverapi()
function which returns a pointer to IBugfixedServer.
- Copy bugfixedapi.inc from [repo dir]/gamedir/addons/amxmodx/scripting/include/bugfixedapi.inc to addons/amxmodx/scripting/include.
- Include bugfixedapi.inc in your plugin.
- You're done.