SA-MP Forums Archive
[sampgdk] Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [sampgdk] Problem (/showthread.php?tid=540988)



[sampgdk] Problem - Nils94 - 08.10.2014

Hello, I have a problem with the sampgdk.
I will only create a plugin with the gdk, not a gamemode.
Everytime I get "Script[gamemodes/bare.amx]: Run time error 19: "File or function is not found"


Source:
pawn Code:
#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();
}



Re: [sampgdk] Problem - xeeZ - 08.10.2014

Quote:
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).

https://sampforum.blast.hk/showthread.php?tid=295798