Note: If anyone is having problems using this plugin, please read this entire post! I have attached all the needed files to make edits to this plugin; if you cannot be bothered to download the files I have provided, I cannot be bothered to reply when you say it doesn't work and haven't read the entire post.
Notice: To edit and recompile this plugin, you must have the MoreColors Include. Everything else that is required to make modifications to this plugin has been provided inside the archive attached.
Background: The story for this mod is rather simple really: I couldn't find a mod that had the specific commands, or worked the way I wanted it to, so I made one. When I first started making this plugin I was extremely novice to SourcePawn, and coding in general, so I did look off of a few other examples to learn. I have provided credit inside the plugin, and I will post (to the best of my recollection) everyone who deserves credit in this post. If you see a feature that is remarkably close to something you have made/released, let me know where it was from and I would be glad to give you the proper credit! This plugin was originally created and tested on Half Life 2: Deathmatch, however, it should work on every Source Engine game!
ConVar List
Spoiler
[u]sm_sb_version - This is the version of Simple-Build the server is running.
sv_sb_enabled - Toggles the plugin's features (0 = Off, 1 = On).
sv_sb_prop_limit - Sets the maximum number of props a player can spawn (Deafult = 100).
sv_sb_logging - Toggles the logging of admin actions. (0 = Off, 1 = On)
Command List
Spoiler
sb_spawn <propname> - Spawns a prop from the prop-list.
sb_create <classname> <model> - ROOT: Always a root admin to spawn special entities.
sb_remove <target> - With no arguments: Removes a prop you are looking at ; Self: Removes all of your props ; Player: Removes a specified player's props
+move / -move - Used to manually move players/props you are looking at
+copy / -copy - Used to copy then move a prop you are looking at.
sb_owner <target> - Changes the ownership of a prop.
sb_propinfo - Returns various information about the prop you are looking at.
sb_move <x> <y> <z> - Moves the prop given units on the given axis (for precision building).
sb_rotate <x> <y> <z> - Rotates the prop given degrees on the given axis.
sb_straight - Returns the prop you're looking at to 0 0 0 angles.
sb_freeze - Freezes the prop you are looking at.
sb_unfreeze - Unfreezes the prop you are looking at.
sb_solid - Changes the solidity of a prop you are looking at.
sb_axis - Creates a 3D representation of the X Y Z axis.
sb_autobuild <amount> <x> <y> <z> <unfrozen> - Autobuilds for you! This aids in bigger structures.
sb_alpha <amount> - Changes the alpha value of the prop you are looking at.
sb_color <r> <g> <b> - Changes the RGB values of the prop you are looking at.
sb_save <save alias> - Saves any an all props you have spawned under a save alias.
sb_load <save alias> - Loads all props under the specified save alias.
[U]sb_undo - Restores a previously deleted prop, from the latest to the first deleted (saves up to 16 by default)
Installation: The installation of this plugin is like all the other plugins out there ... download the provided archive, extract the contents, and place them appropriately into your server. Inisde the archive, all the files necessary to edit and recompile the plugin will be provided, with exception to the MoreColors include file. That can be found here. The plugin will automatically create any and all directories it needs, and any and all files it needs, with exception to the prop list. Inside the archive I have provided a prop list. Said prop list is the exact prop list from SourceOp, only it has been converted in order to be used with this plugin (Thanks DaftMink!). If you have any problems, please feel free to send me a private message, or post on this thread!
Plugin Features:
Prop Ownership: The current ownership of props works such that any prop a client spawns, is owned by said client. Ownership of a prop can be transfered from one client to another using the sb_owner command. Currently, the mod only supports one owner per prop, I will add functionality to allow multiple owners per props soon. The ownership system utilizes the CanUserTarget native, which uses the SourceMod Admin Immunity system. So, admins can target a regular player's props, and depending on how you have your server set up, same level admins can, or cannot, target each other (again, depends on your SourceMod configuration).
Custom Logging: Although I could use the regular SourceMod log functions, I use a custom made one. The reason for this is that whenever I look inside of a SM log file, or source log file, it takes me a very long time to find what it is I am looking for. This way, I can find what it is I am looking for very fast, and the only things inside the log file pertain to SimpleBuild. The path to such logs is: sourcemod/simple-build/logs/month/day/log.txt).
Custom Save/Load Commands: If you frequent a build server, and build something that you wouldn't mind seeing again in the future, you can save it, and load it at any time that you desire. The sb_save command will save every prop that you have spawned, or that you own (caution: if you spawn a prop in one spot, move, and then forget about it, that prop gets saved too!), and it saves it to file named after the alias you provide. So, if you want to see that building again, simply load the same file alias, and it will spawn every prop as it was originally saved. Caution: If you save under an alias that already exists, it will delete the old file, and save the new props to it.
Deletion-Undo Queue: Let's say that someone accidentally deletes a prop, or wants to revert some recent changes they've made. That player can now use the sb_undo command. It saves any prop you delete, up to a defined limit (default 16, can be changed at the top of the script). This command will only revert deletions you have made (to any prop, even if it wasn't yours to begin with).
Change Log:
v1.2.2, 23/01/2014
* Went through the plugin from top to bottom
* Reorganized/renamed various things inside the plugin
* Fixed and and all bugs that were known or found along the way
* Fixed that sb_load command did not load the alpha of the saved prop
* Fixed that sb_undo command did not load the alpha or solidity of the deleted prop
* Updated the +copy command so that it copies every property of the target prop (in previous versions it was missing the alpha property)
* Updated the sb_autobuild command so that it copies every property of the target prop (in previous versions it was missing the alpha property)
* Updated +move and +copy commands so that it restores the target prop to its original colors when done moving/copying
* Updated plugin to use MoreColors
* Updated all targeting commands to use ProcessTargetString (previously I used a manual system to find client by name)
* Updated all commands to have same core circumstances for failure (meaning, if plugin convar is disabled, player is dead, etc)
* Updated the previous prop ownership system (now it uses the SourceMod Immunity System)
* Removed any redundant code found
* Removed chat notifications from almost all of build commands (when using commands rapidly, it became very spammy to be notified every time)
* Added in support for destroyed props (previously, if a prop was destory, it was not deducted from the owner's prop count)
* Added Convar: sv_sb_logging - Toggles the logging of admin actions. (0 = Off, 1 = On) - If enabled, the plugin will log every event where and admin uses a build command on another player's prop
v1.2.0, 17/07/13
* Removed sm_pm Command: I plan on releasing this as a stand-alone plugin (not really meant for a build mod).
* Fixed a rare error that was occurring when a player disconnected before being completely in the server (Thanks DaftMink).
* Changed the prefix on all command (Changed from 'm_' to 'sb_').
* Updated the spawn list (Thanks DaftMink): it now has all the props from SourceOp.
v1.1.8, 09/07/13 - 17/07/13
* Internal testing releases, no public build.
v1.1.6, 09/07/13
* Fixed a compile warning (thanks DaftMink).
* Removed an error inside save/load code (It was temporary to begin with, I forgot to remove it in v0.7.0).
v1.1.4, 30/06/13
* Added Command: m_axis
* Added Command: m_autobuild <amount> <x> <y> <z> <unfrozen>
* Fixed ModelMe Glitch: if you used m_modelme while looking at a func_door, it would crash the server.
* Added Map Support: the save and load commands now save in the directory of the current map.
* Added Spam Protection: there were a few glitches that were noticed when you spammed a command too fast. Added a cool down to each and every command (half a second).
* Restructured the .sp file: it does nothing for the functionality of the plugin, but it makes it easier to work on.
v1.1.2, 04/04/13
* Added Command: sm_pm <player> <message>
* AddedCommand: m_undo
* Removed Command: m_setmass (Not exactly needed, rarely used, only thing that requires vPhysics)
* Added Support to Reload Plugin (Props will automatically be assigned to their old owners)
* Added Spawn Command Options: m_spawn <prop> <frozen|god>
* Fixed Grab/Copy Glitch (If the prop that was being moved/copied was deleted, it broke the command)
* Fixed CheckOwnership Glitch (Regular players could slay others using m_remove command)
* Fixed Remove Options Glitch (Regular players could remove anyone's props)
* Added Timer to Remove Self/Player Props (If the person had a large amount of props, it could break the source engine removing them in the same game frame)
v1.0.0-v1.1.0, 31/03/13 - 03/04/13
* Internal testing releases, no public build.
v1.0.0, 31/03/13
* Initial public release.
Special Thanks:
The Twisted Panda: Without you, this plugin would not exist. You have talked me through some very confusing sections of code when I was starting out, and supplied good portions for a feature or two in this. You answer any and all questions I have, and for all of this I am truly grateful.
Mitchell: You introduced me to coding, and helped me stick through it until now. Also, the move/copy commands you gave me were a huge! help. Thanks, Mitch!
Bubka3: Answers my questions (even if done so reluctantly), and lends an ear when needed. Thank you! Also, gave me code for axis command.
Last edited by Marcus_Brown001; 01-23-2014 at 08:18.
Reason: Updated Version
Yeah .... It works perfectly fine for me. I have a local server set up that I test updates on, and I have never had a problem with it; however, you use to get certain errors using it, but those have all been fixed. It should work without a problem; I have no tested this on TF2 or other source games!
Last edited by Marcus_Brown001; 03-31-2013 at 10:00.
When I add more than 128 props in simple_build_props.ini plugin not loading.
There is limit for 128 props, but plugin isnt compiling so i cant edit it cuz dont have #include <simplebuild>
__________________
Last edited by The Original Shaman; 03-31-2013 at 13:25.
... but plugin isnt compiling so i cant edit it cuz dont have #include <simplebuild>
It really was not all that hard to find .... I uploaded a zip file containing everything someone would need to work on this. Panda has the max config props inside his Build Wars set to 128, and I didn't see the need to change it; however, to change it just edit the line at the top that defines the max config props. The include file is inside the .zip file that is attached to the first post.
And thanks Element!
*Edit*
The next version to be released will have a limit of 512 props. This should allow a little more freedom
Last edited by Marcus_Brown001; 03-31-2013 at 15:36.