AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] OM Prop Spawn - Updated 27/6/2011 (https://forums.alliedmods.net/showthread.php?t=119238)

-.-Owned Myself-.- 02-19-2010 05:10

[ANY] OM Prop Spawn - Updated 27/6/2011
 
4 Attachment(s)
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



anonpiss 02-19-2010 07:37

Re: [CS:S] OM Prop Spawn
 
If I spawn below the floor, will the prop bounce off the floor? Or stick to the floor like the ES SpawnProp script?

-.-Owned Myself-.- 02-19-2010 08:47

Re: [CS:S] OM Prop Spawn
 
Quote:

Originally Posted by anonpiss (Post 1093369)
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.

Nuclear_Suspect 02-19-2010 12:08

Re: [CSS] OM Prop Spawn
 
Interresting, granted i currently use the 'Modelfun' plugin (By pRED i believe), but are your props destructable? (wooden boxes and the like)

-.-Owned Myself-.- 02-19-2010 19:24

Re: [CSS] OM Prop Spawn
 
Currently all props are indestructible. If people want certain props to be destructible I can try to add that feature.

Brotcrunsher 03-02-2010 03:56

Re: [CSS] OM Prop Spawn
 
Hey, very nice plugin, but it would be really really great if you could add the option to spawn prop_statics!

NukeMan 03-26-2010 07:21

Re: [CSS] OM Prop Spawn
 
-.-Owned Myself-.- Nice plugin, but I would like it public for all players, not admins only. It is possible?

-.-Owned Myself-.- 03-26-2010 12:51

Re: [CSS] OM Prop Spawn
 
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!

{123} 04-23-2010 10:59

Re: [CSS] OM Prop Spawn
 
hi guys!
-.-Owned Myself-.- you may add cost to props?

-.-Owned Myself-.- 04-25-2010 16:12

Re: [CSS] OM Prop Spawn - Updated 25/4/2010
 
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.

anonpiss 04-26-2010 21:15

Re: [CSS] OM Prop Spawn - Updated 25/4/2010
 
Interesting. Since you used to be ES scripter, have you taken a look at ES SpawnProp?

So far all the SM version of prop spawning plugins makes the prop bounces against the wall or floor. But this ES prop spawning doesn't make the prop bounce.

http://addons.eventscripts.com/addons/view/spawnprop

{123} 04-27-2010 14:28

Re: [CSS] OM Prop Spawn - Updated 25/4/2010
 
-.-Owned Myself-.- How may create props with GetClientAimTarget? You know as?

-.-Owned Myself-.- 04-27-2010 18:16

Re: [CSS] OM Prop Spawn - Updated 25/4/2010
 
GetClientAimTarget gets the entity the player is looking at. It doesn't actually do what its name implies :O

I tried making the props spawn where the player looked, it did not turn out well when I tried it. I also saw potential for exploitation (spawning props to slow down enemies etc.).

And to answer your question anonpiss, I took a look at that script after you posted it and there's nothing in there that I can use to solve the bouncing problem (except changing the height at which the props spawn.

The Eventscripts versions spawn the props at the userid's location, but I try and replicate the same thing. It may just be a limitation of prop_physics_override.

anonpiss 04-27-2010 22:06

Re: [CSS] OM Prop Spawn - Updated 25/4/2010
 
Ah, finally there is something that ES can do but not on SM. Thanks for the confirmation.

Yes, one of the problem about prop is team proping.

Slash The Mighty 05-22-2010 07:26

Re: [CSS] OM Prop Spawn - Updated 25/4/2010
 
An amazing feature would be if a transparent prop were to appear where you're looking, and then you'd +attack (left click) to spawn it, and +attack2 (right click) to cancel.

This would allow people to build forts and such, rather than the props spawning in walls or just places where they weren't supposed to be.

Edit:

Reading the thread, I see this feature has already been mentioned. Great! 5/5'd the thread for great ideas for further updates.

mjmfighter 07-15-2010 11:27

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Nice plugin, Thanks!

Edit:
A nice feature to this plugin would be paying for props, instead of using credits.

SolidSnake916 08-17-2010 00:26

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Might you make a cvar so i can disable the credit system, because even while being a admin the credit system is obnoxious.

Benjamuffin 08-23-2010 15:54

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Been looking for something like this!

I have a few suggestions though:

1) As previously said, give an option to COMPLETELY disable the whole payment system.
- Some people just want it for themselves on their server as an admin prop spawner, and while there is an admin only feature, it still displays credit messages to players and admins, and uses the payment system.

2) Add a clean up option

- Props can naturally eventually lag and crash servers, and even if there isn't enough to do that, they can block passages and get in the way. A remove all command would be useful.

3) Make the menu stay on after picking something from the list
- It can get tedious to spawn several props at once by going into the menu over and over. This at least needs to be an option.

4) If the plugin is set to admin only, allow spectators to spawn props.
- Admins are (or should be) responsible/trust worthy. Not only that, but some server owners just want it for them, they should be allowed to spawn regardless.

I had a few other little tweaks like the above but canʻt remember any of them.

Other than that however, this is a great plugin, as the standard commands can leave many props stuck at things or in the air!

badwolf 10-29-2010 20:59

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
This plugin is allowing non-admins to spawn props with the om_prop_public set to 0 or 1.. neither one works...

Also, this plugin needs a 'remove all props' command.

-.-Owned Myself-.- 10-31-2010 13:04

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Quote:

Originally Posted by Benjamuffin (Post 1279970)
Been looking for something like this!

I have a few suggestions though:

1) As previously said, give an option to COMPLETELY disable the whole payment system.
- Some people just want it for themselves on their server as an admin prop spawner, and while there is an admin only feature, it still displays credit messages to players and admins, and uses the payment system.

2) Add a clean up option

- Props can naturally eventually lag and crash servers, and even if there isn't enough to do that, they can block passages and get in the way. A remove all command would be useful.

3) Make the menu stay on after picking something from the list
- It can get tedious to spawn several props at once by going into the menu over and over. This at least needs to be an option.

4) If the plugin is set to admin only, allow spectators to spawn props.
- Admins are (or should be) responsible/trust worthy. Not only that, but some server owners just want it for them, they should be allowed to spawn regardless.

I had a few other little tweaks like the above but canʻt remember any of them.

Other than that however, this is a great plugin, as the standard commands can leave many props stuck at things or in the air!

I got the credits to be disabled (bar the price in the menu) however all the messages are now hidden with a simple cvar change. The problem now is the removal of props. I'm finding it a tad bit difficult to get the "targetname" property I set to the prop so I can remove it. It's the last major thing that's been requested and I will then fix/upload the new one when I am done with it.

Quote:

Originally Posted by badwolf (Post 1336980)
This plugin is allowing non-admins to spawn props with the om_prop_public set to 0 or 1.. neither one works...

Also, this plugin needs a 'remove all props' command.

As I've said earlier in this post I have added a feature which should perform this but I am having difficulty in finding specific props which have been spawned (I'm trying to find the targetname which I've set). I've fixed the om_prop_public cvar too.

PAL-18 11-06-2010 18:17

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
I'm trying to use this in garrys mod, but the team checks prevent me from spawning props. How do i disable the team checks?

FrozenHaxor 12-18-2010 08:31

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Why would you need a prop spawner in Garry's Mod? O_O

Sandfly 12-27-2010 09:47

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Hi there Owned Myself,

Great idea for CSS, but could you please advise the correct command line to put in an individual map cfg to disable this function please?

I find that it is not necessary in Escape maps, as the Humans can easily throw up props in important areas to completely stifle opposition pursuit.

I've already tried om_prop_public 1 as a possible command line to stop the prop spawn function on selected maps, but to no avail .. Humans still can spawn props.

Any help would be appreciated. Cheers.

Logifl3x 01-01-2011 03:10

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Hey Owned Myself,

I have a BuildWars server and you hopefully know what that is. But anyways I have a few questions.

1. Is it possible to make it so admins don't have to pay for their props?

2. Is it possible to have a seperate file that we can add extra props for admins?

3. Is it possible to make it that player can delete their own props?

4. Is it possible to make it so admins can delete any props and delete all props?

Heartless 1.0 02-19-2011 10:30

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Could someone make this plugin give credits for kills? Then it would be perfect.

Code:

// The number of credits players earn for each kill

kaskull 03-16-2011 12:50

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Quote:

Originally Posted by Heartless 1.0 (Post 1418882)
Could someone make this plugin give credits for kills? Then it would be perfect.

Code:

// The number of credits players earn for each kill

Please do this !!!

uateam 03-23-2011 16:44

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
this plugin need function like

"Props"
{
"Bench"
{
"model" "models/zp_props/bench/bench01.mdl"
"price" "20"
"admins_only" "1"
}
}

sosi_alliedmodders 03-31-2011 16:23

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
1 Attachment(s)
i do some changes in proplist if someone need it
file in attachment

schau 05-11-2011 11:01

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
How do I add more prop credits?

-.-Owned Myself-.- 05-11-2011 19:31

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Quote:

Originally Posted by schau (Post 1467483)
How do I add more prop credits?

!om_admin_credits <number> in chat.

BIG UPDATE

Code:

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)


I am very sorry it took so long, life got in the way. I think I made the code a lot better than it was before however there may be some bugs still since I didn't fully test it.

kaskull 05-13-2011 12:21

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Quote:

Originally Posted by -.-Owned Myself-.- (Post 1467753)
!om_admin_credits <number> in chat.

BIG UPDATE

Code:

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)


I am very sorry it took so long, life got in the way. I think I made the code a lot better than it was before however there may be some bugs still since I didn't fully test it.

Can you do that when yo kill one person you get more credits... and credits get save... and when you live the server and you return... people have the same credits when he leave

Benjamuffin 06-08-2011 00:03

Re: [ANY] OM Prop Spawn - Updated 25/4/2010
 
Just started using this plugin again, it's a lot nicer now. A lot of the functions requested are all nice and in there and such. Hurrah!

One thing bugging me that I noticed straight away was the:

Quote:

Originally Posted by Benjamuffin (Post 1279970)
Make the menu stay on after picking something from the list

Is still an issue for me. Would be great if that could be added?

Heartless 1.0 06-19-2011 06:28

Re: [ANY] OM Prop Spawn - Updated 12/5/2011
 
I've tested v3 in CSS and there are some bugs.

!om_remove_props does not work (!om_remove_prop brings up OMPropSpawnProp1_number0 in the console and chat).

om_prop_teamonly does not work correctly. I set it to 2 for CT and it did not allow me to use the menu for spec and CT, but it did with T. (Maybe got the numbers mixed up?)

I don't like how admins are able to spawn an unlimited amount of props without credits. Players and admins should not have advantages over each other. I think you should make credits count for admins when om_prop_public is set to 0.

-.-Owned Myself-.- 06-26-2011 19:36

Re: [ANY] OM Prop Spawn - Updated 12/5/2011
 
Quote:

Originally Posted by Benjamuffin (Post 1483390)
Just started using this plugin again, it's a lot nicer now. A lot of the functions requested are all nice and in there and such. Hurrah!

One thing bugging me that I noticed straight away was the:



Is still an issue for me. Would be great if that could be added?

Sorry I must have missed this request before, I've added it now.

Quote:

Originally Posted by Heartless 1.0 (Post 1491302)
I've tested v3 in CSS and there are some bugs.

!om_remove_props does not work (!om_remove_prop brings up OMPropSpawnProp1_number0 in the console and chat).

om_prop_teamonly does not work correctly. I set it to 2 for CT and it did not allow me to use the menu for spec and CT, but it did with T. (Maybe got the numbers mixed up?)

I don't like how admins are able to spawn an unlimited amount of props without credits. Players and admins should not have advantages over each other. I think you should make credits count for admins when om_prop_public is set to 0.

Damn my stupidity! I forgot to add the actual prop removing part :S That should be in there now. I also fixed the Team issue I believe.

New version will be uploaded in a sec with the following changes:

  • 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

Mirun.Frontier 07-07-2011 02:18

Re: [ANY] OM Prop Spawn - Updated 27/6/2011
 
The plugin isn't working for me, well it is, but it always returns "You Can't Use This Command!" when doing !props or /props. I dont see any other way of using a spawn menu. Using it for TF2.

sosi_alliedmodders 07-14-2011 07:06

Re: [ANY] OM Prop Spawn - Updated 27/6/2011
 
Tested in ZPS 2.2 works fine... but seems I detect a few bugs with prop point spawn entities (glitch props)

morion 07-22-2011 23:50

Re: [ANY] OM Prop Spawn - Updated 27/6/2011
 
is it possible with this plugin to save the postions of the props per map so that they get reloaden on map change ?

that would be very usefull.

thanks

sosi_alliedmodders 07-24-2011 09:32

Re: [ANY] OM Prop Spawn - Updated 27/6/2011
 
Owned myself , i suspect some bugs with this plugin. So first of all you'll need to fix menu close after dead, because when someone die a player could spawn all props around hes body (glitch) and the second is block prop spawn when people step on player's way, to avoid prop kill. And the last is compatible with zombie panic source. Thanks

look screenshot: http://s1136.photobucket.com/albums/...8-07_00002.png

sosi_alliedmodders 07-24-2011 10:21

Re: [ANY] OM Prop Spawn - Updated 27/6/2011
 
1 Attachment(s)
Hey, i added multilingual translation in Russian and Ukrainian languages, also you may edit if you have differenced language

Enjoy

General bugs / Features

1.1 Fix correct client menu display
--------------------------------------------------------
Not displaying how much points do you earn when you kill someone

KaiserJeeĈ 09-18-2011 05:51

Re: [ANY] OM Prop Spawn - Updated 27/6/2011
 
Is it possible to spawn props that dont disappear after mapchange, and take props from a map and copy it? What im getting at it could be fun to steal some halloween stuff from some maps, and put into the standardmaps, to get the right halloween vipe


All times are GMT -4. The time now is 07:41.

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