[Help] Not Invoking native
#1

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...
Reply
#2

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.
Reply
#3

Quote:
Originally Posted by iRana
View Post
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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)