[Help] Not Invoking native - 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: Plugin Development (
https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Help] Not Invoking native (
/showthread.php?tid=407502)
[Help] Not Invoking native -
iRana - 14.01.2013
Hey I just learn a bit about plugin dev. from tutorial and tried the code but some how plugin is't invoking native.
Code:
cell AMX_NATIVE_CALL KickId(AMX* amx, cell* params)
{
if(g_Invoke->callNative(&PAWN::Kick, params[1]))
{
g_Invoke->callNative(&PAWN::SendClientMessage, params[1], 0xFFFFFFFF, "Bye{FF0000} Bye{FFFFFF} Player.");
g_Invoke->callNative(&PAWN::Kick, params[1]);
return 1;
}
else logprintf(cell AMX_NATIVE_CALL KickId(AMX* amx, cell* params)
{
if(g_Invoke->callNative(&PAWN::Kick, params[1]))
{
g_Invoke->callNative(&PAWN::SendClientMessage, params[1], 0xFFFFFFFF, "Bye{FF0000} Bye{FFFFFF} Player.");
g_Invoke->callNative(&PAWN::Kick, params[1]);
return 1;
}
else logprintf("Problem in Function!");
return 0;);
return 0;
Here plugin is printing "Problem in Function!" means else statement is executing...
Here is full code:
http://pastebin.com/g1vh3dEN
One more question: Can we use gta sa original natives ? not samp ones...
Respuesta: [Help] Not Invoking native -
oOFotherOo - 14.01.2013
Friend you must create the native Invoke_GetAddresses, Example:
Code:
static cell AMX_NATIVE_CALL Invoke_GetAddresses(AMX* amx, cell* params)
{
return g_Invoke->getAddresses();
}
const AMX_NATIVE_INFO PluginNatives[] =
{
{"KickId", KickId},
{"Invoke_GetAddresses", Invoke_GetAddresses},
{0, 0}
};
This serves to invoke functions to load the GameMode.
Re: [Help] Not Invoking native -
Gamer_Z - 24.01.2013
Quote:
Originally Posted by iRana
One more question: Can we use gta sa original natives ? not samp ones...
|
Only in client sided plugins. (however there is no official sa-mp client plugin sdk, nor even official plugin support by the sa-mp client application)