Raised This Month: $32 Target: $400
 8% 

[SOLVED][CS:GO] Random Weapon Spawner


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
trevor_leong
Member
Join Date: May 2015
Location: Singapore
Old 12-16-2015 , 05:27   [SOLVED][CS:GO] Random Weapon Spawner
Reply With Quote #1

There are a couple of plugins that have a similar purpose to this suggestion as seen here and here but what I was really looking for was it has these features:

- The map file is not updated upon this plugin but rather like a "mapname.cfg" is what adds the weapon spawns in the map

- Automatically generates a "mapname.cfg" in /addons/sourcemod/configs/weaponspawns/ when a new map is loaded without a .cfg file. If this is not possible to be created, then the person must manually create a .cfg file to be wrriten on for the current map.

- The chance and quantity of each type of weapon can be set

- Adding spawnpoints as one of the features is optional (though I highly recommend it if you plan to make this plugin as an official release to others as well). Meaning there would be a command to allow the plugin to automatically spawn random weapons on the map or that specific spawnpoints set by the player admin is where the spawns may or may not spawn or both. Example (though preferably if created like this):

// Default: 1
sm_weaponspawn_enable 0/1 // 0 - disable 1 - enable

// Default: 1
sm_weaponspawn_spawntype 1/2/3 // 1 - enable random weapon spawn 2 - enable random weapon on set spawnpoint(s) 3 - both

sm_weaponspawn_list // Shows the weapon spawn list

sm_weaponspawn_add // Adds a weapon spawn point on where the player is standing. If specified what weapon, it will only spawn that weapon in that spawn point only

sm_weaponspawn_undo // Deletes last spawnpoint

sm_weaponspawn_reset // Resets all weapon spawns on current map

// Default: 1
sm_weaponspawn_skin 0/1 (optional!) // 0 - Weapon spawns have no skin by default 1- Weapon spawns will follow player's skin on pickup

// Default: 0
sm_weaponspawn_clearweapons 0/1 // 0 - Maps with premade weapon spawns by default will not be deleted 1 - Deletes all premade weapon spawns on the map

- Compatability with CS:GO Steam Workshop maps

The config file in /addons/sourcemod/configs/weaponspawns/mapname.cfg can look something like this:

Code:
"mapname"
{ 
	"min_spawns"	"10" // Default amount in every .cfg file generated. This comment is not needed to be added in the actual config file
	"max_spawns"	"32" // Default amount in every .cfg file generated. This comment is not needed to be added in the actual config file

    // Weapon spawnpoints are below

	"#1"
	{
		"pos"	"-100 -100 -100"
	}
	"#2"
	{
		"pos"	"-200 -200 -200"
		"weaponspawn type" "ak47" // Only added if sm_weaponspawn_add is specified. This comment is not needed to be added in the actual config file
	}
}
The other config found in /addons/sourcemod/configs/ can be found here:

Code:
"Weapon-Spawn"
{
	"AWP"
	{	
		"chance"	"25" // in percentage
		"minimum"	"0"
		"maximum"	"1"
	}
	"AK47"
	{	
		"chance"	"75"
		"minimum"	"1
		"maximum"	"3"
	}
}

The reason why I ask for someone to create this plugin when something similar is already created is because I noticed that with this plugin it actually seems to give the clients too many packets (the console actually outputs that), causing them to actually have a timeout countdown for a few seconds, which makes the player think that it is a server issue. I also realised that the plugin saves your spawn so as long the server does not restart, which in some cases should the server ever crash I would have to set the spawns again.

Also if you are wondering why I prefer a config file over actually changing the whole map is actually because I use the Steam Workshop for the maps to download, so should there ever be a map update, the whole previous spawns will be resetted once again. Also, players then can delete spawnpoints in there should they ever forget to undo their last spawnpoint (oh ya btw that means that each time a new spawn point is added, the pos will say in the client's chat). Besides, I think that the map would be updated each time the server loads because the server has to revalidate to become same as the Steam Workshop's map.

Possible Questions you might have...

Q: What use does this plugin have?
A: Well for a lot of maps I play actually, most notably jailbreak and ttt maps, they don't come with weapon spawns. Which is why this plugin would be useful for many JB and TTT owners in CS:GO to use to add weapon spawns in the map or simply have the plugin run it to automatically place the weapon spawns

Q: Why should I create a config file over actually changing the whole map? Also, can't Valve's hammer editor do this?
A: Well for starters, I would think that when you actually edit the whole map, clients who have existing map files would be unable to join the server because their map differs from the server's which has weapon spawns. Also this way it is more flexible for different servers. Some servers prefer having spawnpoints for weapon at different places. Though it is proven to be fixed in sm_weaponspawn_clearweapons 1, but I think it is more unlikely to cause client and server file confliction if the map was just clear instead. Also for idiots like myself who do not know how to use hammer (and I've heard that there are issues with it being slow and all), it would be impossible for me to add weapon spawns in.

Q: What you demand is unreasonable, there are certain things that you can't do or it's too hard as you stated!
A: I would admit that what I demand is little bit ambitious with all the plugin commands and all, but if you do manage to do it and update it to work with games other than CS:GO, it would be really useful! Oh and btw I have about zero knowledge when it comes to SourcePawns or the stuff to create plugins so I do not know of the limitations of what SourceMod plugins can do, forgive me if I gave really gave impossible features suggestions. I also gave you my idea of how I envision the plugin should look and have, and also thought that I would cut some of your worries by naming it and creating the files as seen above in the examples. Of course you have my thanks for using my way

Thanks in advance~

EDIT: This plugin has been fufilled by Zipcore. Credits to him for his plugin!

Last edited by trevor_leong; 12-17-2015 at 22:33.
trevor_leong is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-16-2015 , 10:11   Re: [CS:GO] Random Weapon Spawner
Reply With Quote #2

First of all I've read your whole posting and there are some ideas I'll add to my plugin:
  • workshop map support (just forgot to add this) EDIT: already done
  • Allow the admin to delete the prev set spawn EDIT2: done

Furthermore here are some solutions to your problems:
  • There is a cvar to remove weapons which are spawned by the map itself: mp_weapons_allow_map_placed
  • You didn't set enough spawnpoints, by default the lootspawner trys to fill 125 spots, or just reduce this setting. This will fix the timeout bug which I'll fix next update anyway.
  • You can adjust the plugin to spawn only loot during the roundstart or just during the round.
  • If your spawns are not saved than you should check the folder configs/lootspawns for write permissions

Other:
  • My plugin is designed as a loot system which means I'll not add support for fixed loot spawns for special items.
  • Using a %-chance system is not a good idea, you would have to ensure all spawnable stuff is under 100%, my plugins works like a pool chance system, which means 100% is the amount added of all types.
  • The lootspawner provides natives which can be used to delete all spawned loot. If you need a plugins which for example deletes all loot after a delay from roundstart just ask me.
__________________

Last edited by zipcore; 12-16-2015 at 12:13.
zipcore is offline
trevor_leong
Member
Join Date: May 2015
Location: Singapore
Old 12-16-2015 , 23:23   Re: [CS:GO] Random Weapon Spawner
Reply With Quote #3

Oh hi. Fancy seeing the zipcore plugin creator himself lol.

Quote:
Originally Posted by zipcore View Post
First of all I've read your whole posting and there are some ideas I'll add to my plugin:
  • workshop map support (just forgot to add this) EDIT: already done
  • Allow the admin to delete the prev set spawn EDIT2: done
Nice, but I'm not sure if workshop maps are still working. I am still using the Steam Workshop map to host my server btw.

Quote:
Originally Posted by zipcore View Post
Furthermore here are some solutions to your problems:
  • There is a cvar to remove weapons which are spawned by the map itself: mp_weapons_allow_map_placed
Oh I didn't know there was already an implemented command for it lol

Quote:
Originally Posted by zipcore View Post
  • You didn't set enough spawnpoints, by default the lootspawner trys to fill 125 spots, or just reduce this setting. This will fix the timeout bug which I'll fix next update anyway.
How do I reduce the default setting? If you're talking about zcore_lootspawner_spawn_max_roundstart which is 125 by default, I changed it but still get the timeout bug.

Quote:
Originally Posted by zipcore View Post
  • You can adjust the plugin to spawn only loot during the roundstart or just during the round.
What do you mean by spawning the loot during the round? Do you mean like for example the round's time is 2 minutes, that means in that 2 minutes, the weapons will randomly spawn from time to time?

Quote:
Originally Posted by zipcore View Post
  • If your spawns are not saved than you should check the folder configs/lootspawns for write permissions

Quote:
Originally Posted by zipcore on git.tf
  • create and grant write permissions to this directory: "addons/sourcemod/configs/lootspawns/"
This is the part I don't get though, what do you mean by write permissions and how can I grant write permissions? If you're talking about Windows file permission, I made sure to change it for all users to be able to write on the folder. Unfortunately, the results is still the same. Oh ya and btw I did create a folder in configs/lootspawns and that was the folder that I "granted write permission".

Quote:
Originally Posted by zipcore View Post
Other:
  • My plugin is designed as a loot system which means I'll not add support for fixed loot spawns for special items.
I don't really get what you meant by special items but okay.

Quote:
Originally Posted by zipcore View Post
  • Using a %-chance system is not a good idea, you would have to ensure all spawnable stuff is under 100%, my plugins works like a pool chance system, which means 100% is the amount added of all types.
Alright then, that's a compromise that I am willing to make. Though with adding it will make each round more unique but I guess a much more concerning issue for me now is to get the spawnpoints for each map to be saved and loaded each time I restart the server.

Quote:
Originally Posted by zipcore View Post
  • The lootspawner provides natives which can be used to delete all spawned loot. If you need a plugins which for example deletes all loot after a delay from roundstart just ask me.
Wait so that means that the plugin updates the actual map file with the new weapon spawnpoints? I am little confused with the way you phrase things sorry. Also why is there a delay after roundstart? Is it to delete all the loots?

Quote:
Originally Posted by zipcore on git.tf
  • Adjust the master config in "/cfg/zcore/lootspawner.cfg"
What is a master config? Do you mean like the file that is usually generated in /cfg/sourcemod/ for most plugins? If not, where do I put this file?

============================================= ============================================= =============================================

On a complete side note, I was actually reading your post in my bed at midnight till 1.30am and I was scrambling my brain so hard to try to comprehend what you're saying. It is only the next morning (which is at the moment I am typing this though it is already afternoon cause of how much I am editing it) that I finally knew how to reply. Pardon me if I sound rude, but for a slight moment I started having the assumption that you're kind of one of those people on SourceMod who give slip shot replies even when they claim to be "wanting to help". Or maybe your first language is not English? Then I can completely understand and I would apologise for being very judgmental. But one thing I must say though, is that you have my compliments for reading my whole post. Out of all the views on my post, I can say for sure that you're the first one to read my whole post and even comment on it.

EDIT: A quick update on the progress of this suggestion. I've added Zipcore on Steam, one of the plugin developers of a similar plugin that I wanted and he is working on making it work for CS:GO, or well TTT rather. He says the plugin was originally intended for Hunger Games so there was no guarantee it would work for TTT maps. He is almost done, but there will still be more testing needed to carry out being I can officially say this suggestion is already created.

Last edited by trevor_leong; 12-17-2015 at 06:42.
trevor_leong is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-18-2015 , 05:17   Re: [SOLVED][CS:GO] Random Weapon Spawner
Reply With Quote #4

I've rewritten the plugin to solve all issues.
__________________
zipcore is offline
NotMe
Junior Member
Join Date: Jun 2016
Old 06-29-2016 , 14:27   Re: [SOLVED][CS:GO] Random Weapon Spawner
Reply With Quote #5

Hey! i want to know if this plugin still works fine. I need this plugin soo badly. When i do the spawnpoints and then reload the whole thing then my server just chrashes.
NotMe 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 19:56.


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