AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [ANY] Disco Mod! *Updated: 2/26/13 (https://forums.alliedmods.net/showthread.php?t=180520)

Mitchell 03-16-2012 21:28

[ANY] Disco Mod! *Updated: 2/26/13
 
6 Attachment(s)
Description:
If you may have noticed on event scripts there is a disco mod, well im here to tell you that i made that 2x better, with better effects, and better music playing! What i have done is that you can set up to 30 songs in a config file, with this it uses the MOTD panel function, so there's no reason you would need to make clients download large mp3's for something to simple.
http://i.imgur.com/GXIPb.jpg



How it works:
  1. Admin (with specified flag type's !discomenu)
  2. The Disco Menu comes up
  3. Select Start Disco
  4. Pick a song, which the installer defines.
  5. Above the admin's head popups a disco ball!
  6. GO back to the menu and push Stop Disco to stop the disco
  7. Or Type motd in chat to turn off your personal music.
ConVars: (must reload the config if changed mid game)
DO NOT TOUCH UNLESS YOU KNOW WHAT YOU'RE DOING.

sm_disco_custommodel - Default "models/roller_spikes.mdl", Set this to a model that will be the disco ball.
sm_disco_zoffset - Default "0.0", Offset on the Z pos for the lights..
sm_disco_rotation - Def: "11.25 0.0 11.25", Rotation of the ball.

Custom Model (S-Low's Disco Ball) Cvars:
sm_disco_custommodel "models/props/slow/spiegelkugel/slow_spiegelkugel.mdl"
sm_disco_zoffset "42.0"
sm_disco_rotation "0.0 11.25 0.0"
PUT THESE IN YOUR: cfg/sourcemod/plugin.disco.cfg

Please NOTE THAT YOU NEED TO USE THIS PLUGIN FOR DISCOBALL TO DOWNLOAD TO THE CLIENTS: SM DOWNLOADER
http://i.imgur.com/rZIP4.jpg

Current Bugs: (that cant be fixed!)
  • Connecting Late will not play the song to that player
  • If a player is looking at the motd, the page will change.
  • If a player goes to a page it will stop the music
Commands:
sm_disco_reloadconfig - Reloads the musicconfig.cfg, with out reloading the plugin. Also recache's the cvars

Todo:
  1. Make the config file compatible with songs in the local directory.
  2. I tried to add FOG like in the other script, but couldnt get it to work, every where else is abandoned subject, any suggestions on the fog idea?
  3. ?? Suggestions?
CONFIG FILE TUTORIAL:
Please Note if you do not want a sound with version 0.1.7 you dont have to have a config file. and it will not play any music.

The Config file must be saved in the sourcemod/config folder as: musicconfig.cfg

Code:

"MusicConfig"
{
    "DJ Fresh - Gold Dust"
    {
        "path"                "mikes-revenge.net/sandboxx/music/index.php?id=gold_dust.mp3"
    }
    "Skrillex - Cinema"
    {
        "path"                "mikes-revenge.net/sandboxx/music/index.php?id=cinema.mp3"
    }
    "Example - Kickstarts"
    {
        "path"                "mikes-revenge.net/sandboxx/music/index.php?id=Kickstarts.mp3"
    }
}

Also i included the webpage i use on my site. Just place it in the site, and then use yoursite.com/disco/index.php?id=SONGNAME.mp3 in the config.
Link Below

Credits:
DoctorMcKay, Even with out asking i used his url for his music :P
Fearts, Gave me the idea to re-write the script into sourcemod. :D

Changes:
Code:

2/26/13 = 1.0.0: Deleted excess stuff, fixed some precache errors, made more cvars.
6-27-12 = 0.3.0: Deleted most of the removing of the handles, should work fine now i tested it several time witch changing the maps
4-5-12 = 0.2.0: Fixed a invalid handle error.
3-18-12 = 0.1.9: Added sm_disco_reloadconfig command.
3-17-12 = 0.1.8: Added stopmusic command, and also added the custom model built in Added "No song" to the menu.
3-17-12 = 0.1.7: Lol on the version update and the update date.. anyways i added the function of not needing the config file for songs.
3-16-12 = 0.1.6: Fixed an error on the menu cause i cant code when im tired.
3-16-12 = 0.1.5: added round_end hook, so it would make sure to remove the timer.
3-16-12 = 0.1.4: Fixed the menu crashing, also made it so it finds the ceiling but if its too high then it will create it 312 units above the player, and all lasers point down now, not going up.
3-16-12 = 0.1.3: Fixed the Disco ball crashing the server, cause it technically existed but not physically.
3-16-12 = 0.1.2: Fixed the menu not wanting to close.
3-16-12 = 0.1.1: Changed !disco to !discomenu, might have conflicted with funcommand plugin.

DOWNLOAD:

Unreal1 03-16-2012 21:42

Re: [ANY] Disco Mod! *Published: 3/16/12
 
Quote:

Originally Posted by Mitchell (Post 1670273)

DoctorMcKay, Even with out asking i used his url for his music :P


LOL

Mitchell 03-16-2012 21:47

Re: [ANY] Disco Mod! *Published: 3/16/12
 
i went to go show him and he told me i should ask first D:, but he was iight with it.

Fearts 03-16-2012 22:42

Re: [ANY] Disco Mod! *Updated: 3/16/12
 
God damn dude. I suggest he make this like last night and it is already done. You're a beast dude.

Mitchell 03-16-2012 22:45

Re: [ANY] Disco Mod! *Updated: 3/16/12
 
Most of it i tipped from like the mod ytou showed me (the admin flags)
The config was from my shop mod i changed some of it.
and the disco timer was easy.
i also ripped the sprites off of vog_fireworks. :P

Fearts 03-17-2012 01:09

Re: [ANY] Disco Mod! *Updated: 3/17/12
 
2 Attachment(s)
EDIT: USE CODE IN OP

I am using a modified version with a real disco ball model made by S-Low. I attached the files to this post if your interested in the model version.

http://i.imgur.com/rZIP4.jpg

Dr. McKay 03-17-2012 05:04

Re: [ANY] Disco Mod! *Updated: 3/17/12
 
Looks impressive, especially with the disco ball model.

I don't mind a few people using my bandwidth, but I'd appreciate if people could host their own MP3s. :) Can you take my URLs out of your default config?

You might mention that music requires Flash For Other Browsers on the clients.

Could a version be made that doesn't play music, only does the disco effects?

Finally, it'd be nice if you removed the "Made by Mitch" thing in the menu. The majority of people using the plugin won't know who "Mitch" is, and if anyone cares who made it, there's sm plugins.


Feedback on the code:

PHP Code:

public Action:DoUrl(clientString:url[128])
{
    new 
Handle:setup CreateKeyValues("data");
    
    
KvSetString(setup"title""DISCO");
    
KvSetNum(setup"type"MOTDPANEL_TYPE_URL);
    
KvSetString(setup"msg"url);
    
    
ShowVGUIPanel(client"info"setupfalse);
    
CloseHandle(setup);
    return 
Plugin_Handled;


No need for DoUrl to return anything, nor for it to be public. Try this:
PHP Code:

DoUrl(clientString:url[128])
{
    new 
Handle:setup CreateKeyValues("data");
    
    
KvSetString(setup"title""DISCO");
    
KvSetNum(setup"type"MOTDPANEL_TYPE_URL);
    
KvSetString(setup"msg"url);
    
    
ShowVGUIPanel(client"info"setupfalse);
    
CloseHandle(setup);


Why open Google to stop music? Use about:blank.

Provide a command accessible to users to turn off the music. Telling them to type motd won't work if the server has a textual MOTD or if basetriggers isn't running.

Please don't use a cvar for access to a command. Use RegAdminCmd instead and we can continue using our override system.

Mitchell 03-17-2012 10:31

Re: [ANY] Disco Mod! *Updated: 3/17/12
 
Quote:

Originally Posted by Dr. McKay (Post 1670414)
I don't mind a few people using my bandwidth, but I'd appreciate if people could host their own MP3s. :) Can you take my URLs out of your default config?

Will do :P

Quote:

Originally Posted by Dr. McKay (Post 1670414)
Could a version be made that doesn't play music, only does the disco effects?

This version already does that if there is no config, but i will try to add a "no song" option in the menu.

Quote:

Originally Posted by Dr. McKay (Post 1670414)
Finally, it'd be nice if you removed the "Made by Mitch" thing in the menu. The majority of people using the plugin won't know who "Mitch" is, and if anyone cares who made it, there's sm plugins.

Yeah i know.

Quote:

Originally Posted by Dr. McKay (Post 1670414)
Why open Google to stop music? Use about:blank.

Thats what i was going to do but i got tired making it last night and didnt finish.

Quote:

Originally Posted by Dr. McKay (Post 1670414)
Provide a command accessible to users to turn off the music. Telling them to type motd won't work if the server has a textual MOTD or if basetriggers isn't running.

It's in my todo list.

Quote:

Originally Posted by Dr. McKay (Post 1670414)
Please don't use a cvar for access to a command. Use RegAdminCmd instead and we can continue using our override system.

Forgot about that option, could have saved me some time, but i also liked this option cause i could change the flag in real time. ANy ideas what the flag should be?

AeroAcrobat 03-17-2012 15:44

Re: [ANY] Disco Mod! *Updated: 3/17/12
 
24/7 cp_foundry no time limit. worked as I tested first but later nothiung happend. only menu could be opened.

PHP Code:

L 03/17/2012 20:30:57: [SMNative "KillTimer" reportedInvalid timer handle 40df01fd (error 1)
L 03/17/2012 20:30:57: [SMDisplaying call stack trace for plugin "disco.smx":
L 03/17/2012 20:30:57: [SM]   [0]  Line 211, /home/groups/alliedmodders/forums/files/7/4/2/3/4/100738.attach::StartStopDisco()
L 03/17/2012 20:30:57: [SM]   [1]  Line 486, /home/groups/alliedmodders/forums/files/7/4/2/3/4/100738.attach::Menu_DiscoSL() 


Mitchell 03-17-2012 16:05

Re: [ANY] Disco Mod! *Updated: 3/17/12
 
Im not 100% sure how tf2 event's are.


All times are GMT -4. The time now is 10:00.

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