Raised This Month: $ Target: $400
 0% 

Putting all plugins in 1 SMA?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2010 , 11:51   Re: Putting all plugins in 1 SMA?
Reply With Quote #5

Quote:
Originally Posted by Seta00 View Post
Copy paste all functions, and add calls to the additional ones in the end of the original functions.
For example, you have two plugins that use Ham_TakeDamage:

Code:
// Plugins merged: plugin_init() {     RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage"); // leave only one registration } public Ham_TakeDamage() {     // mimimi..     FwdTakeDamage(id); } public FwdTakeDamage() {     // bla bla bla... }
Quote:
Originally Posted by grimvh2 View Post
PHP Code:
// Plugins merged:
plugin_init() {
    
RegisterHam(Ham_TakeDamage"player""Ham_TakeDamage"); // leave only one registration
}

public 
Ham_TakeDamage() {
    
// mimimi..
    // bla bla bla

This won't always work because, for example, one plugin may require altering a param value (and return HAM_HANDLED) while another may require to block all damage (via return HAM_SUPERCEDE). This is why multiple Ham_TakeDamage registers\forwards may be required; it all depends on what the plugins do.
__________________

Last edited by Bugsy; 05-29-2010 at 12:33.
Bugsy 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 05:16.


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