MASSIVE UPDATE - Now Requires SMLIB
Please Note that this is for compilation purposes only. You do not need this for running the plugin.
A little background on the plugin
This is my first public sourcemod plugin ever! Basically I wanted admins on my Zombiemod server to be able to spawn props. However each time I ran into a snag when attempting this with Eventscripts. I could only spawn Prop_Physics and Prop_Physics_Dynamic, which isn't very useful.
So I made this plugin! It allows Server Admins to spawn props which are defined in a text file (working example included). I wanted a safe way for admins to spawn props so I learnt a bit of Sourcepawn and here is the result!
Model Menu - by pRED*
- Without this, it would have taken me much longer to get my head around Keyvalues and Menus.
- I can't remember where I obtained this, but it's thanks to this that I know how to make props spawn in a nice way! It was nearly perfect for me, however not very user friendly.
Open om_public_props.txt and you'll find this:
As you can see each prop can now have a "price" option. This sets the price for the prop if om_prop_public is set to 0. If there is no price option set in the file for a prop, it will be free to spawn.
If you wanted to change the height at which the individual prop spawned at:
"adminonly" "1" //Means it's admin only if set to 1
(or /props) - Brings up the menu for spawning props. - Requires Slay Flag
(or /credits) - Shows you how many credits you have. (Public)
!om_admin_credits <name> <credits>
- Allows you to modify player credits. Minus numbers can be used to remove credits.
- Removes all props created by players
om_prop_public <number> -0 means anyone can use this plugin. 1 means admins only
om_prop_teamonly <number> - 0 is no restrictions, 1 is Terrorist and 2 is CT. Default: 0
om_propspawn_version - Shows the plugin version
- The number of credits a player should get when they spawn. Default: 20
- 1 means props are removed on death, 0 means they aren't
- 1 means credits are added when a player kills someone, 0 means they aren't.
- The number of credits added when a player kills someone. Default: 5
And that's all I can think of putting down! Currently I have only tested this on CS:S
but I don't see why it wouldn't work on any other source game (TF2 for instance), but i'm a newb at Sourcepawn so don't expect it to!
Currently tested and working on:
Team Fortress 2
If anyone tests this on other games, please tell me if it loaded successfully and functioned properly and I will add the game to the list!
Attached should be:
om_propspawn.sp (thus the smx)
All props spawned are prop_physics_override
V1.0.0: Initial Release
Added new "height" string to define custom spawn heights for each prop.
Rewrite of plugin:
- It now works on a system of credits.
- Server Administrators can set whether or not normal players can spawn props (at a price).
- 2 new ConVars added.
- Team Only Setting added (Very useful for Zombiemod.) Spectators cannot spawn props anymore, no matter what value this ConVar is.
- Replaced om_props.txt with om_public_props.txt
- Uses ClientPrefs to manage credits.
Another Rewrite of plugin:
- Fixed a lot of stuff
- Clientprefs no longer used
- SMLib is now used
- Fixed Admin Only commands (I hope)
- Added ways of removing props
- Props are removed on client disconnect
- Added "adminonly" property for props (see example)
- Added a way for credits to be added when a player kills someone
- Made the menu appear automatically after spawning a prop
- Fixed Team restriction issues
- Fixed props not being named properly
- Fixed props not actually being deleted when using the command
- Added debug mode in source code