Raised This Month: $168 Target: $400
 42% 

[ANY] OM Prop Spawn - Updated 27/6/2011


Post New Thread Reply   
 
Thread Tools Display Modes
Author
-.-Owned Myself-.-
Member
Join Date: Jul 2008
Plugin ID:
1479
Plugin Version:
3.0.2
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    14 
    Plugin Description:
    A plugin which allows you to spawn physics props predefined in a text file
    Old 02-19-2010 , 05:10   [ANY] OM Prop Spawn - Updated 27/6/2011
    Reply With Quote #1

    MASSIVE UPDATE - Now Requires SMLIB
    http://forums.alliedmods.net/showthread.php?p=1398699

    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!

    Special Thanks

    Model Menu - by pRED* - Without this, it would have taken me much longer to get my head around Keyvalues and Menus.

    RP_Tools - 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.

    -------------------------


    Installation:

    Extract om_propspawn.smx to addons/sourcemod/plugins
    Extract om_public_props.txt to addons/sourcemod/configs

    Configuration


    Open om_public_props.txt and you'll find this:

    Code:
    "Props"
    {
        "Vending Machine"
        {
                "model"            "models/props/cs_office/vending_machine.mdl"
                "height"        "50"
                "price"            "15"
        }
        "Sofa"
        {
                "model"            "models/props/cs_office/sofa.mdl"
                "price"            "5"
        }
        "Book Shelf"
        {
                "model"            "models/props/cs_office/bookshelf1.mdl"
        }
        "Dryer Box"
        {
                "model"            "models/props/cs_assault/dryer_box.mdl"
                "price"            "5"
        }
    }
    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:
    Code:
    "Props"
    {
        "Vending Machine"
        {
                "model"            "models/props/cs_office/vending_machine.mdl"
                "height"            "50"
                "adminonly"      "1" //Means it's admin only if set to 1
        }
    }
    Commands

    !props (or /props) - Brings up the menu for spawning props. - Requires Slay Flag

    !credits (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.

    !om_remove_props - Removes all props created by players

    ConVars

    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

    om_prop_credits <number> - The number of credits a player should get when they spawn. Default: 20

    om_prop_removeondeath <number> - 1 means props are removed on death, 0 means they aren't

    om_prop_addcreditsonkill <number> - 1 means credits are added when a player kills someone, 0 means they aren't.

    om_prop_killcredits <number> - 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:
    Counter-Strike:Source
    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)
    om_public_props.txt

    Little Note:
    All props spawned are prop_physics_override


    Changelog:
    Code:
    V1.0.0: Initial Release
    
    V1.0.1:
    Added new "height" string to define custom spawn heights for each prop.
    
    Example:
    "Props"
    {
        "Vending Machine"
        {
                "model"            "models/props/cs_office/vending_machine.mdl"
                "height"            "50"
        }
    }
    
    V2.0.0
    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.
    V3.0.0 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
    V3.0.2
    • 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
    Attached Files
    File Type: txt om_public_props.txt (392 Bytes, 1872 views)
    File Type: sp Get Plugin or Get Source (om_propspawn.sp - 1243 views - 12.9 KB)
    File Type: zip om_propspawn.zip (21.5 KB, 2464 views)
    File Type: smx om_propspawn.smx (16.4 KB, 849 views)

    Last edited by -.-Owned Myself-.-; 06-26-2011 at 19:42. Reason: Title Changed - New Version
    -.-Owned Myself-.- is offline
    anonpiss
    Senior Member
    Join Date: Jan 2010
    Old 02-19-2010 , 07:37   Re: [CS:S] OM Prop Spawn
    Reply With Quote #2

    If I spawn below the floor, will the prop bounce off the floor? Or stick to the floor like the ES SpawnProp script?
    anonpiss is offline
    -.-Owned Myself-.-
    Member
    Join Date: Jul 2008
    Old 02-19-2010 , 08:47   Re: [CS:S] OM Prop Spawn
    Reply With Quote #3

    Quote:
    Originally Posted by anonpiss View Post
    If I spawn below the floor, will the prop bounce off the floor? Or stick to the floor like the ES SpawnProp script?
    Wasn't expecting this question at all :O I tried it and if you go a certain distance below the floor, it will stick to the floor above (and sort of twitch). I'm not sure if there's a fix for this.

    [EDIT]:
    I've added a "height" string for props. This lets you define a custom spawn height. If no height is set, the default value of 100 is used.

    Last edited by -.-Owned Myself-.-; 02-19-2010 at 10:11.
    -.-Owned Myself-.- is offline
    Nuclear_Suspect
    Member
    Join Date: Oct 2009
    Old 02-19-2010 , 12:08   Re: [CSS] OM Prop Spawn
    Reply With Quote #4

    Interresting, granted i currently use the 'Modelfun' plugin (By pRED i believe), but are your props destructable? (wooden boxes and the like)
    Nuclear_Suspect is offline
    -.-Owned Myself-.-
    Member
    Join Date: Jul 2008
    Old 02-19-2010 , 19:24   Re: [CSS] OM Prop Spawn
    Reply With Quote #5

    Currently all props are indestructible. If people want certain props to be destructible I can try to add that feature.
    -.-Owned Myself-.- is offline
    Brotcrunsher
    New Member
    Join Date: Mar 2010
    Old 03-02-2010 , 03:56   Re: [CSS] OM Prop Spawn
    Reply With Quote #6

    Hey, very nice plugin, but it would be really really great if you could add the option to spawn prop_statics!
    Brotcrunsher is offline
    NukeMan
    BANNED
    Join Date: Mar 2010
    Old 03-26-2010 , 07:21   Re: [CSS] OM Prop Spawn
    Reply With Quote #7

    -.-Owned Myself-.- Nice plugin, but I would like it public for all players, not admins only. It is possible?
    NukeMan is offline
    -.-Owned Myself-.-
    Member
    Join Date: Jul 2008
    Old 03-26-2010 , 12:51   Re: [CSS] OM Prop Spawn
    Reply With Quote #8

    To do this:
    Open admin_overrides.cfg in addons/sourcemod/configs

    Add:
    Quote:
    "om_propspawn" ""
    And the command should then be accessible to all players. You may need to restart the server.

    Make sure it isn't in the comments section!
    -.-Owned Myself-.- is offline
    {123}
    New Member
    Join Date: Apr 2010
    Old 04-23-2010 , 10:59   Re: [CSS] OM Prop Spawn
    Reply With Quote #9

    hi guys!
    -.-Owned Myself-.- you may add cost to props?
    {123} is offline
    -.-Owned Myself-.-
    Member
    Join Date: Jul 2008
    Old 04-25-2010 , 16:12   Re: [CSS] OM Prop Spawn - Updated 25/4/2010
    Reply With Quote #10

    Hi guys, I've updated the plugin!

    I've done a rewrite of it (from scratch with some copy and paste).

    You can now set whether or not this will be public (set it in a cfg file.)

    It also includes a credits system which uses clientprefs. Player credits are updated every time players are spawned.

    Hopefully this enhances the gameplay experience for those who want to use this plugin.
    -.-Owned Myself-.- is offline
    Reply


    Thread Tools
    Display Modes

    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 02:25.


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