#include <amx/amx.h>
#include <amx/getch.h>
#include <plugincommon.h>
#include <sampgdk/a_players.h>
#include <sampgdk/a_samp.h>
#include <random>
#define MYSQL_SERVER_NAME (5001)
#define MYSQL_SERVER_PASSWORD (5002)
#define MYSQL_SERVER_USER (5003)
#define MYSQL_SERVER_DATABASE (5004)
typedef void (*logprintf_t)(char* format, ...);
logprintf_t logprintf;
extern void* pAMXFunctions;
int AMX_NATIVE_CALL GetRandom(AMX* amx, cell* params)
{
int minimum = params[1];
int maximum = params[2];
int range = maximum - minimum + 1;
int generated = rand() % range + minimum;
return generated;
}
cell AMX_NATIVE_CALL GetMySQL(AMX* amx, cell* params)
{
int mysqlData = params[1];
cell* address = NULL;
amx_GetAddr(amx, params[2], &address);
cell addressSize = params[3];
if (mysqlData == MYSQL_SERVER_NAME) amx_SetString(address, "localhost", 0, 0, addressSize);
if (mysqlData == MYSQL_SERVER_PASSWORD) amx_SetString(address, "lkjg282g", 0, 0, addressSize);
if (mysqlData == MYSQL_SERVER_USER) amx_SetString(address, "root", 0, 0, addressSize);
if (mysqlData == 5004) amx_SetString(address, "amentesrp", 0, 0, addressSize);
return 1;
}
int AMX_NATIVE_CALL SetPlayerFactionType(AMX* amx, cell* params)
{
int playerid = params[1];
int faction = params[2];
SetPVarInt(playerid, "pFaction", faction);
return 1;
}
When i try to compiler this codes, SetPlayerFactionType always gives me that error and i dont know why. If i delete SetPlayerFactionType function, VS compiles project without an error. where am i making a mistake? I also added sampgdk4d.lib as Additional Library
When i try to compiler this codes, SetPlayerFactionType always gives me that error and i dont know why. If i delete SetPlayerFactionType function, VS compiles project without an error. where am i making a mistake? I also added sampgdk4d.lib as Additional Library
Thanks