View Single Post
nergal
Veteran Member
Join Date: Apr 2012
Old 12-24-2016 , 20:05   Re: New API and Syntax
Reply With Quote #828

Quote:
Originally Posted by WildCard65 View Post
And code responsible for adding function to forward?
PHP Code:
CreateNative("Mode_HookEx"Native_HookEx);

public 
int Native_HookEx(Handle pluginint numParams)
{
    
int hookIndex GetNativeCell(1);
    
    Function 
Func GetNativeFunction(2);
    if (
g_hForwards[hookIndex] != null)
        return 
AddToForward(g_hForwards[hookIndex], pluginfunc);
    return 
0;
}

// in subplugin
public void fwdOnMenu(Menu menu)
{
    
menu.AddItem("6""Testing Forward");
    for (
int i=MaxClients ; --i)
        if ( 
IsClientInGame(i) )
            
PrintToConsole(i"fwdOnMenu:: ==> Called");

__________________
nergal is offline