Raised This Month: $ Target: $400
 0% 

'Hybrid' Plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asdian
Member
Join Date: Sep 2016
Location: Indonesia
Old 09-23-2021 , 02:38   Re: 'Hybrid' Plugin?
Reply With Quote #1

Quote:
Originally Posted by Celena Luna View Post
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.
i see...
PHP Code:
if (equal(module"zp50_core")) 
is 'module' code meant the .sma ?
asdian is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 09-23-2021 , 03:27   Re: 'Hybrid' Plugin?
Reply With Quote #2

Quote:
Originally Posted by asdian View Post
i see...
PHP Code:
if (equal(module"zp50_core")) 
is 'module' code meant the .sma ?
I am not sure but I think it is also referring to the library.
__________________
My plugin:
Celena Luna is offline
asdian
Member
Join Date: Sep 2016
Location: Indonesia
Old 09-23-2021 , 05:15   Re: 'Hybrid' Plugin?
Reply With Quote #3

Quote:
Originally Posted by Celena Luna View Post
I am not sure but I think it is also referring to the library.
the .inc ?
asdian is offline
Reply



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