Raised This Month: $ Target: $400
 0% 

'Hybrid' Plugin?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 09-22-2021 , 23:47   Re: 'Hybrid' Plugin?
Reply With Quote #4

Quote:
Originally Posted by asdian View Post
how to use that native filter to prevent error with zp_ natives ?
PHP Code:
new bool:IsZPRunning false //Boolean to check if ZP is running.

public plugin_natives()
{
    
set_native_filter("native_filter")
    
set_module_filter("module_filter")
}

public 
native_filter(const name[], indextrap)
{
    if(!
trap)
        return 
PLUGIN_HANDLED
    
    
return PLUGIN_CONTINUE
}

public 
module_filter(const module[])
{
    if (
equal(module"zp50_core"))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
plugin_init()
{
    if(
LibraryExists("zp50_core"LibType_Library)) 
        
IsZPRunning true //if zp50_core loaded, plugin will be in ZP mode


//I will make example here when tanking damage
public fw_Player_TakeDamage(victiminflictorattackerFloat:DamageiDamageBits)
{
    if(
IsZPRunning)
    {
        if(
zp_core_is_zombie(id)
        {
             
//Do ZP stuff
            
SetHamParamFloat(42000.0)
        }
    }
    else
   {
       
//Do Normal CS Mode stuff
      
SetHamParamFloat(4100.0)
   }

If you want to know if there is a Libary, check the include file
Code:
#if AMXX_VERSION_NUM >= 175     #pragma reqlib zp50_core     #if !defined AMXMODX_NOAUTOLOAD         #pragma loadlib zp50_core     #endif #else     #pragma library zp50_core #endif

Because zombieplague.inc doesn't have libary, it can't be check this way.
__________________
My plugin:

Last edited by Celena Luna; 09-22-2021 at 23:53.
Celena Luna is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode