View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-01-2015 , 17:13   Re: How to reorganize code in a huge plugin?
Reply With Quote #3

You can split a plugin into separate files without turning it into separate plugins.

For example in NativeVotes:
  • nativevotes.sp has the core functionality of the plugin plus its natives
  • nativevotes/data-keyvalues.sp has all the things for manipulating a vote handle "owned" by NativeVotes (its named data-keyvalues because the backing store may change later)
  • nativevotes/game.sp has functions for individual games that NativeVotes supports as well as Game_ abstract functions that determines which function to call for which game.

That's just an example and your plugin may be done differently. basevotes is another plugin to take a look at as it consists of basevotes.sp and a separate sp file for each vote type is supports.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-01-2015 at 17:14.
Powerlord is offline