#include <stdio.h>
#include <string.h>
#include <sampgdk/a_players.h>
#include <sampgdk/a_samp.h>
#include <sampgdk/core.h>
#include <sampgdk/sdk.h>
#define AMX_DECLARE_NATIVE(native) \
cell AMX_NATIVE_CALL native(AMX* amx, cell* params)
using sampgdk::logprintf;
AMX_DECLARE_NATIVE(CheckUser)
{
if (!IsPlayerConnected(params[1])) return printf("The user %d isn't connected !", params[1]), 1;
char name[25];
GetPlayerName(params[1], name, 25);
printf("This was printed from the Test plugin! Yay %s!", name);
return 1;
}
PLUGIN_EXPORT bool PLUGIN_CALL OnPlayerConnect(int playerid) {
return true;
}
PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports() {
return sampgdk::Supports() | SUPPORTS_PROCESS_TICK;
}
PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) {
return sampgdk::Load(ppData);
}
PLUGIN_EXPORT void PLUGIN_CALL Unload() {
sampgdk::Unload();
}
SUPPORTS_AMX_NATIVES This is yet another define that is to be used by our "Supports()" function. Any plugin that uses AMX functions must use this flag! Without this flag you'll get a run time 19 error due to your natives not registering with the server (amx_Register). |