Hi guys. I am trying to do simple amxmodx module, but everytime i try to do it it fail.
I install the module, upload it to my server, i say amx_modules and i see "unknown" bad load
I am using CMAKE and cross g++.
PHP Code:
#include "sdk/amxxmodule.h"
#include "sdk/moduleconfig.h"
#include <iostream>
static cell AMX_NATIVE_CALL YtestLoad(AMX *amx, cell *params)
{
int params_n = params[0] / sizeof(cell);
if(params_n != 1)
{
MF_LogError(amx, AMX_ERR_NATIVE,"Invalid parameter count. Expecting one parameter");
return 0;
}
return 0;
}
AMX_NATIVE_INFO nativess[] = {
{"Ytest_Load", YtestLoad},
{NULL,NULL}
};
void OnAmxxAttach()
{
MF_AddNatives(nativess);
}
This is my code.
And this is my CMAKE:
PHP Code:
cmake_minimum_required(VERSION 3.10)
project(YTest)
set(CMAKE_CXX_STANDARD 11)
add_library(YTest SHARED library.cpp sdk/amxxmodule.cpp sdk/amxxmodule.h)
set_target_properties(YTest PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
amxmodx sdk was official from Amxmodx github, but after fail i update it to the from okapi (
https://forums.alliedmods.net/showthread.php?t=234986). And i am using Linux Ubuntu 18.04.