SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/10/2014, 07:47 PM   #1
Nils94
Little Clucker
 
Join Date: Nov 2011
Location: Germany
Posts: 22
Reputation: 0
Question [sampgdk] Problem

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();
}
Nils94 is offline   Reply With Quote
Old 08/10/2014, 09:30 PM   #2
xeeZ
Huge Clucker
 
Join Date: Feb 2013
Posts: 320
Reputation: 382
Default Re: [sampgdk] Problem

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).
http://forum.sa-mp.com/showthread.php?t=295798
xeeZ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SampGDK AroseKhanNiazi Scripting Help 4 16/09/2014 11:03 AM
sampgdk RCON1 Plugin Development 26 08/06/2014 12:03 PM
SAMPGDK Framework GWMPT Everything and Nothing 23 04/06/2014 08:30 PM


All times are GMT. The time now is 01:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.