Raised This Month: $7 Target: $400
 1% 

Dispenser Music Choice - Rex Subplugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Seacrh_Inkeeper
Junior Member
Join Date: Jun 2020
Location: Moscow, Russia
Old 06-27-2020 , 10:07   Dispenser Music Choice - Rex Subplugins
Reply With Quote #1

Hi!

It's my first post here, so don't judge strictly :)

Updated the old one plugin (ordinary post - https://forums.alliedmods.net/showthread.php?p=1982288) with some new features.

1) New commands:
1.1) sm_dm <number> or !dm <number> - select the current song for your dispenser if it's built. Song list based on config further down the post. Default Flag - Reservation.
1.2) sm_dmtarget @player <number> or !dmtarget @player <number> - the same as previous one, but now you can select dispenser music for other players (only for 1 per time). Default Flag - Cheats.
1.3) sm_dmall <number> or !dmall <number> - select music for all dispensers on map. Will not work, if dispenser has no owner, forced by RTD or disabled for the owner with !dispenser command. Default Flag - Cheats.
1.3.1) CVAR sm_dmusic_delay (def = 30.0) - players can't select music with !dm after someone used !dmall for this amout of seconds.

2) Now plugin is fully compatible with backpackdispenser and multiple_buildings plugins.
3) Music removes after end of the round or dispenser owner's death (and if dispenser was destoyed).

4) !dm can be used only if:
4.1) You are alive
4.2) You are engineer
4.3) You have build the dispenser
4.4) You turned on !dispenser command, which allows playing music

5) If some dispensers are in the one area at the same moment, admin can use !dmall to select one melody for all of them, which will be bassboosted for as many dispensers as are beside each other.

----

Old ones:
1) sm_dispenser or !dispenser - Allow your dispensers playing music. Rebuild your dispenser after changing this setting.
2) Songs are going one by one.

----
Some bugs:
1) !dm_all will not work, if there are more than 5 dispensers in one place at the same moment.
2) The same for !dm and !dmtarget if you use multiple_buildings plugin.
3) Rare error: !dm, !dmtarget, !dmall only remove sounds without playing the selected ones. Just rewrite the command.

config goes to addons/sourcemod/configs. Don't forget to add something!
plugin goes to addons/sourcemod/plugins.
Attached Files
File Type: cfg dispenser_music.cfg (202 Bytes, 80 views)
File Type: sp Get Plugin or Get Source (dispenser_music.sp - 68 views - 17.0 KB)
File Type: smx dispenser_music.smx (12.0 KB, 66 views)

Last edited by Seacrh_Inkeeper; 06-27-2020 at 10:51.
Seacrh_Inkeeper is offline
WhiteFalcon
Member
Join Date: Nov 2019
Old 06-27-2020 , 10:29   Re: Dispenser Music Choice - Rex Subplugins
Reply With Quote #2

Good work, ̶b̶u̶t̶ ̶y̶o̶u̶ ̶f̶o̶r̶g̶o̶t̶ ̶t̶o̶ ̶s̶h̶a̶r̶e̶ ̶t̶h̶e̶ ̶s̶o̶u̶r̶c̶e̶c̶o̶d̶e̶.̶

Last edited by WhiteFalcon; 06-27-2020 at 10:32.
WhiteFalcon is offline
Seacrh_Inkeeper
Junior Member
Join Date: Jun 2020
Location: Moscow, Russia
Old 06-27-2020 , 10:33   Re: Dispenser Music Choice - Rex Subplugins
Reply With Quote #3

Quote:
Originally Posted by WhiteFalcon View Post
Good work, ̶b̶u̶t̶ ̶y̶o̶u̶ ̶f̶o̶r̶g̶o̶t̶ ̶t̶o̶ ̶s̶h̶a̶r̶e̶ ̶t̶h̶e̶ ̶s̶o̶u̶r̶c̶e̶c̶o̶d̶e̶.̶
Done
Seacrh_Inkeeper is offline
NoloZero01
Member
Join Date: May 2020
Location: Async Research Institute
Old 06-27-2020 , 10:51   Re: Dispenser Music Choice - Rex Subplugins
Reply With Quote #4

From what I see, the plugin is a combination of old and new syntax, and it's recommended that you don't mix these two. It's not a serious issue, but I recommend you to update it if you intend to continue supporting the plugin.

I also think VSH/Freak Fortress is not the place where this should be posted, general Plugins thread is way better.
Quoting the forum's rules:
"If you post (or see a post) in the wrong section, use the Report Post button to request it be moved rather than replying to the thread."

Last edited by NoloZero01; 06-27-2020 at 10:53.
NoloZero01 is offline
WhiteFalcon
Member
Join Date: Nov 2019
Old 06-27-2020 , 10:53   Re: Dispenser Music Choice - Rex Subplugins
Reply With Quote #5

took a quick look, here are some critics/feedback for now:
if you want to rework on it, dont copy mistakes.
by that i mean:
1- never store entity by its index.
2- do you really need to convert entity index to string just to insert a handle it to a trie
3- you know you can use ArrayList(2) instead of two different versions of ArrayList()?
4- you don't need to delete cookies onpluginend, since they will be automatically freed
5- Like NoloZero01 said, don't mix old syntax with new ones
6- This is wrong section to post plugin, use Plugins thread

Last edited by WhiteFalcon; 06-27-2020 at 11:11. Reason: too slow
WhiteFalcon is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-27-2020 , 14:53   Re: Dispenser Music Choice - Rex Subplugins
Reply With Quote #6

Unfortunately plugins can't be moved into the plugins forum, you'll need to re-post it there.
__________________
asherkin 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 22:58.


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