[Tutorial] Plugin development guide
#50

Quote:
Originally Posted by zgintasz
View Post
What the hell... I'm just trying to use invoke and here is my results . Please, help someone.



Code:
#include "SDK\amx\amx.h"
#include "SDK\plugincommon.h"

#include "Invoke.h"

typedef void (*logprintf_t)(char* format, ...);


logprintf_t logprintf;
extern void *pAMXFunctions;


cell AMX_NATIVE_CALL HelloWorld(AMX* amx, cell* params)
{
    logprintf("This was printed from the Test plugin! Yay!");
    return 1;
}

PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports() 
{
    return SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES;
}

PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) 
{
	invoke = new Invoke;
    pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS];
    logprintf = (logprintf_t) ppData[PLUGIN_DATA_LOGPRINTF];

    logprintf(" * Test plugin was loaded.");

    return true;
}

PLUGIN_EXPORT void PLUGIN_CALL Unload()
{
    logprintf(" * Test plugin was unloaded.");
}

AMX_NATIVE_INFO PluginNatives[] =
{
    {"HelloWorld", HelloWorld},
    {0, 0}
};

PLUGIN_EXPORT int PLUGIN_CALL AmxLoad( AMX *amx ) 
{
	invoke->amx_list.push_back(amx);
    return amx_Register(amx, PluginNatives, -1);
}


PLUGIN_EXPORT int PLUGIN_CALL AmxUnload( AMX *amx ) 
{
	for (std::list<AMX *>::iterator i = invoke->amx_list.begin(); i != invoke->amx_list.end(); ++i)
	{
	    if (* i == amx)
		{
			invoke->amx_list.erase(i);
			break;
		}
	}
    return AMX_ERR_NONE;
}
It looks like you are using VS 2010. Can you try compiling manually using GCC++ from Command Prompt?
Reply


Messages In This Thread
Plugin development guide - by Kyosaur - 08.11.2011, 00:25
Re: Plugin development guide - by Kyosaur - 08.11.2011, 00:27
Re: Plugin development guide - by GTA-Hancock - 08.11.2011, 01:26
Re: Plugin development guide - by dowster - 08.11.2011, 02:16
Re: Plugin development guide - by Norn - 08.11.2011, 03:06
Re: Plugin development guide - by Lorenc_ - 08.11.2011, 04:38
Re: Plugin development guide - by Karlip - 08.11.2011, 05:07
AW: Plugin development guide - by BigETI - 08.11.2011, 05:21
Re: Plugin development guide - by Slice - 08.11.2011, 05:59
Re: Plugin development guide - by Hiddos - 08.11.2011, 06:44
Re: Plugin development guide - by Kyosaur - 08.11.2011, 13:51
Re: Plugin development guide - by playbox12 - 08.11.2011, 14:01
Re: Plugin development guide - by XFlawless - 08.11.2011, 14:08
Re: Plugin development guide - by Kyosaur - 08.11.2011, 17:14
Re: Plugin development guide - by Kostas' - 08.11.2011, 17:22
AW: Re: Plugin development guide - by BigETI - 08.11.2011, 17:25
Re: AW: Re: Plugin development guide - by Kyosaur - 08.11.2011, 18:12
Re: Plugin development guide - by Calgon - 08.11.2011, 18:14
AW: Re: AW: Re: Plugin development guide - by BigETI - 08.11.2011, 18:16
Re: Plugin development guide - by Kyosaur - 08.11.2011, 18:28
Re: Plugin development guide - by Calgon - 08.11.2011, 18:32
Re: Plugin development guide - by TheArcher - 08.11.2011, 18:59
Re: Plugin development guide - by Kyosaur - 08.11.2011, 19:03
Re: Plugin development guide - by Stigg - 08.11.2011, 19:15
Re: Plugin development guide - by Kyosaur - 09.11.2011, 19:40
Re: Plugin development guide - by MicroD - 09.11.2011, 19:48
Re: Plugin development guide - by Kyosaur - 09.11.2011, 20:01
Re: Plugin development guide - by GangsTa_ - 11.11.2011, 14:51
Re: Plugin development guide - by Gamer_Z - 11.11.2011, 15:04
Re: Plugin development guide - by Kyosaur - 11.11.2011, 15:05
Re: Plugin development guide - by GangsTa_ - 11.11.2011, 15:26
Re: Plugin development guide - by juraska - 11.11.2011, 16:24
Re: Plugin development guide - by Gamer_Z - 11.11.2011, 17:11
Re: Plugin development guide - by Rudo2 - 20.11.2011, 16:54
Re: Plugin development guide - by Kyosaur - 20.11.2011, 22:31
Re: Plugin development guide - by Rudo2 - 22.11.2011, 20:04
Re: Plugin development guide - by Kyosaur - 22.11.2011, 23:21
Re: Plugin development guide - by Mark™ - 24.11.2011, 07:27
Re: Plugin development guide - by Rudo2 - 24.11.2011, 14:55
Re: Plugin development guide - by Fool - 29.11.2011, 10:25
Re: Plugin development guide - by Kyosaur - 22.12.2011, 18:20
Re: Plugin development guide - by Kyosaur - 23.12.2011, 04:16
Re: Plugin development guide - by Max_Coldheart - 14.01.2012, 07:23
Re: Plugin development guide - by Kyosaur - 14.01.2012, 07:36
Re: Plugin development guide - by Kaperstone - 14.01.2012, 10:59
Re: Plugin development guide - by -Prodigy- - 23.01.2012, 04:17
Re: Plugin development guide - by Kyosaur - 23.01.2012, 21:50
Re: Plugin development guide - by Jonny5 - 07.04.2012, 16:33
Re: Plugin development guide - by zgintasz - 15.06.2012, 08:41
Re: Plugin development guide - by Cassandra - 15.06.2012, 09:18
Re: Plugin development guide - by Rancho - 05.07.2012, 16:03
Re: Plugin development guide - by zgintasz - 09.07.2012, 08:26
Re: Plugin development guide - by JoBullet - 09.07.2012, 10:32
Re: Plugin development guide - by zgintasz - 09.07.2012, 11:12
Re: Plugin development guide - by JoBullet - 09.07.2012, 13:39
AW: Plugin development guide - by NetKiel - 22.07.2012, 11:32
Re: Plugin development guide - by Lorenc_ - 31.07.2012, 22:42
Re: Plugin development guide - by Rancho - 02.08.2012, 01:06
Re: Plugin development guide - by misho1 - 06.08.2012, 21:04
Re: Plugin development guide - by Edvin - 26.09.2012, 16:57
Re: Plugin development guide - by Plovix - 11.11.2012, 06:52
Respuesta: Plugin development guide - by Megalock - 22.11.2012, 19:02
Respuesta: Plugin development guide - by Megalock - 02.12.2012, 10:10
Re: Plugin development guide - by GWMPT - 09.12.2012, 15:39
Re: Plugin development guide - by TheArcher - 09.12.2012, 17:32
Re: Plugin development guide - by steki. - 18.01.2013, 12:28
Re: Plugin development guide - by iggy1 - 14.02.2013, 14:07
Re: Plugin development guide - by KubiPL - 22.02.2013, 15:56
Respuesta: Re: Plugin development guide - by oOFotherOo - 22.02.2013, 16:12
Re: Plugin development guide - by a.z.a.r - 23.03.2013, 20:49
Re: Plugin development guide - by SMX - 23.03.2013, 21:48
Re: Plugin development guide - by MyLife - 26.03.2013, 15:50
Re: Respuesta: Plugin development guide - by Shaft - 06.04.2013, 15:20
Re: Plugin development guide - by Tumba - 07.05.2013, 12:46
Re: Plugin development guide - by Guest123 - 11.05.2013, 05:29
Re: Plugin development guide - by Emmet_ - 11.05.2013, 05:46
Re: Plugin development guide - by Aeonosphere - 17.05.2013, 17:22
Re: Plugin development guide - by Slice - 17.05.2013, 17:26
Re: Plugin development guide - by Edvin - 26.05.2013, 18:32
Re: Plugin development guide - by Manowar - 09.06.2013, 20:29
Re: Plugin development guide - by Isolated - 08.07.2013, 15:26
Re: Plugin development guide - by RebeloX - 13.07.2013, 01:30
Re: Plugin development guide - by OrMisicL - 13.07.2013, 01:50
Re: Plugin development guide - by Chipotle - 12.08.2013, 12:55
Re: Plugin development guide - by Dolby - 25.09.2013, 01:49
Re: Plugin development guide - by GWMPT - 16.10.2013, 20:02
Re: Plugin development guide - by OrMisicL - 16.10.2013, 20:06
Re: Plugin development guide - by GWMPT - 16.10.2013, 20:14
Re: Plugin development guide - by Rancho - 16.03.2014, 19:22
Re: Plugin development guide - by GWMPT - 16.03.2014, 19:50
Re: Plugin development guide - by iFarbod - 19.04.2014, 13:41
Re: Plugin development guide - by iZN - 19.04.2014, 13:50
Re: Plugin development guide - by xeeZ - 19.04.2014, 13:51
Re: Plugin development guide - by iFarbod - 20.04.2014, 11:05
Respuesta: Plugin development guide - by JustBored - 20.04.2014, 18:15
Re: Plugin development guide - by RCON1 - 20.04.2014, 18:41
Re: Respuesta: Plugin development guide - by xeeZ - 20.04.2014, 18:47
Respuesta: Re: Respuesta: Plugin development guide - by JustBored - 20.04.2014, 19:16
Re: Plugin development guide - by RCON1 - 20.04.2014, 20:00
Respuesta: Plugin development guide - by JustBored - 28.04.2014, 20:46
Re: Plugin development guide - by RCON1 - 04.05.2014, 08:40
Re: Plugin development guide - by ikkentim - 04.05.2014, 11:39
Re: Plugin development guide - by RCON1 - 04.05.2014, 12:49
Re: Plugin development guide - by RCON1 - 09.05.2014, 12:21
Re: Plugin development guide - by MikE1990 - 09.05.2014, 12:41
Re: Plugin development guide - by RCON1 - 09.05.2014, 13:39
Re: Plugin development guide - by MikE1990 - 09.05.2014, 14:18
Re: Plugin development guide - by KingHual - 09.05.2014, 15:07
Re: Plugin development guide - by MikE1990 - 09.05.2014, 15:13
Re: Plugin development guide - by xeeZ - 09.05.2014, 15:34
Re: Plugin development guide - by MikE1990 - 09.05.2014, 15:48
Re: Plugin development guide - by kadaradam - 11.05.2014, 08:47
Re: Plugin development guide - by KingHual - 11.05.2014, 09:01
Re: Plugin development guide - by kadaradam - 11.05.2014, 09:31
Re: Plugin development guide - by RCON1 - 24.05.2014, 14:24
Re: Plugin development guide - by Mexanizm93 - 30.05.2014, 01:22
Re: Plugin development guide - by Admigo - 12.07.2014, 09:35
Re: Plugin development guide - by d711728 - 15.07.2014, 14:41
Re : Plugin development guide - by S4t3K - 15.07.2014, 15:44
Re: Plugin development guide - by Admigo - 16.07.2014, 20:00
Re : Plugin development guide - by S4t3K - 27.07.2014, 00:21
Re : Plugin development guide - by Papawy - 27.07.2014, 00:43
AW: Plugin development guide - by Nils94 - 08.10.2014, 17:46
Re : Plugin development guide - by S4t3K - 08.10.2014, 18:15
AW: Plugin development guide - by Nils94 - 08.10.2014, 19:06
Re: AW: Plugin development guide - by KingHual - 08.10.2014, 19:31
Re: Plugin development guide - by kaZax - 16.01.2015, 12:54
Re: Plugin development guide - by codectile - 22.01.2015, 07:13
Re: Plugin development guide - by Kar - 23.04.2015, 01:07
Re: Plugin development guide - by Abagail - 23.04.2015, 01:28
Re: Plugin development guide - by Pottus - 23.04.2015, 03:04
Re: Plugin development guide - by Kar - 23.04.2015, 03:19
Re: Plugin development guide - by ikkentim - 23.04.2015, 09:47
Re: Plugin development guide - by Kar - 23.04.2015, 10:16
Re: Plugin development guide - by Typhome - 16.06.2015, 19:46
Re: Plugin development guide - by Vince - 16.06.2015, 20:32
Re: Plugin development guide - by Typhome - 19.06.2015, 11:20
Re: Plugin development guide - by RaeF - 26.07.2015, 10:34
Re: Plugin development guide - by SkittlesAreFalling - 03.12.2015, 10:28
Re: Plugin development guide - by Slice - 03.12.2015, 11:09
Re: Plugin development guide - by SkittlesAreFalling - 03.12.2015, 11:18
Re: Plugin development guide - by Neavorce - 03.12.2015, 11:37
Re: Plugin development guide - by SkittlesAreFalling - 03.12.2015, 11:45
Re: Plugin development guide - by kurta999 - 02.02.2016, 18:45
Re: Plugin development guide - by Slice - 02.02.2016, 20:17
Re: Plugin development guide - by kurta999 - 13.02.2016, 15:20
Re: Plugin development guide - by Yashas - 13.02.2016, 15:46
Re: Plugin development guide - by xeeZ - 14.02.2016, 07:47
Re: Plugin development guide - by maddinat0r - 14.02.2016, 08:48
Re: Plugin development guide - by kurta999 - 14.02.2016, 12:28
Re: Plugin development guide - by kurta999 - 14.02.2016, 14:28
Re: Plugin development guide - by DRIFT_HUNTER - 16.03.2016, 06:59
Re: Plugin development guide - by codectile - 21.06.2016, 14:05
Re: Plugin development guide - by Yashas - 21.06.2016, 14:34
Re: Plugin development guide - by codectile - 21.06.2016, 16:04
Re: Plugin development guide - by Yashas - 22.06.2016, 07:10
Re: Plugin development guide - by codectile - 22.06.2016, 08:52
Re: Plugin development guide - by kurta999 - 05.12.2016, 20:30
Re: Plugin development guide - by Yaa - 05.12.2016, 20:56
Re: Plugin development guide - by Konstantinos - 05.12.2016, 21:13
Re: Plugin development guide - by Yaa - 05.12.2016, 21:51
Re: Plugin development guide - by ODINA - 19.12.2017, 03:38
Re: Plugin development guide - by DJefferson - 24.01.2018, 22:05
Re: Plugin development guide - by GuyYahood1 - 25.01.2018, 16:43
Re: Plugin development guide - by dani18 - 12.02.2018, 22:35

Forum Jump:


Users browsing this thread: 2 Guest(s)