Raised This Month: $ Target: $400
 0% 

Putting all plugins in 1 SMA?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drosado15
Junior Member
Join Date: Aug 2009
Old 05-29-2010 , 08:53   Putting all plugins in 1 SMA?
Reply With Quote #1

I'm pretty sure the correct way to do this is put all the includes at the top for all the plugins like so.
// Includes
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csx>
#include <fakemeta>
#include <hamsandwich>


Then break the plugins up by // correct?
drosado15 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2010 , 09:11   Re: Putting all plugins in 1 SMA?
Reply With Quote #2

Why do you want to do this?

You are lucky if you can copy all functions to one source file and have it work as expected. Don't get me wrong, this can be done but you will need to know what you are doing to make adjustments if/where needed to make it work. Since you're asking this question I will assume you are not very experienced so I would not bother attempting this.
__________________
Bugsy is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 05-29-2010 , 10:11   Re: Putting all plugins in 1 SMA?
Reply With Quote #3

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:
//Plugin 1 plugin_init() {     RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage"); } public Ham_TakeDamage(id) {     // mimimi.. }
Code:
//Plugin 2 plugin_init() {     RegisterHam(Ham_TakeDamage, "player", "FwdTakeDamage"); } public FwdTakeDamage(id) {     // bla bla bla... }

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... }
Seta00 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 05-29-2010 , 11:10   Re: Putting all plugins in 1 SMA?
Reply With Quote #4

Quote:
Originally Posted by Seta00 View Post
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... }

PHP Code:
// Plugins merged:
plugin_init() {
    
RegisterHam(Ham_TakeDamage"player""Ham_TakeDamage"); // leave only one registration
}

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

__________________
I am out of order!
grimvh2 is offline
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
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 05-29-2010 , 16:12   Re: Putting all plugins in 1 SMA?
Reply With Quote #6

Bugsy I am aware of that. The point is, like u have already said. He does'nt have the expierence to put plugins together. He should better leave plugins as they are.
__________________
I am out of order!
grimvh2 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2010 , 18:10   Re: Putting all plugins in 1 SMA?
Reply With Quote #7

Quote:
Originally Posted by grimvh2 View Post
Bugsy I am aware of that. The point is, like u have already said. He does'nt have the expierence to put plugins together. He should better leave plugins as they are.
Based on your previous post, it looked as if you were providing a code example for combining multiple takedmg fwds. Hence, my reply.
__________________
Bugsy 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 05:16.


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