Thread: [Solved] callfunc_* alternative
View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-13-2019 , 12:07   Re: callfunc_* alternative
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
callfunc_end will return whatever you returned in the target function. PLUGIN_* are just numbers.
I know PLUGIN_* are just numbers, I just didn't know about callfunc_end returning.

So basically like this?
PHP Code:
public OnShopMenuHandleridiMenuiItem )
{
    
// code

    
callfunc_begin_ieItemDataiItemFuncID ], eItemDataiItemPlugin ] )
    
callfunc_push_intid )
    
    if( 
callfunc_end( ) == PLUGIN_HANDLED )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
// code
    
return PLUGIN_CONTINUE;

PHP Code:
public plugin_init( )
{
    
register_extra_item"Item Name"ITEM_COST "CallBackHandler" );
}

public 
CallBackHandlerid )
{
    return 
PLUGIN_HANDLED;

__________________

Last edited by edon1337; 08-13-2019 at 12:08.
edon1337 is offline