Ulysses

Ulysses Stuff => Releases => Topic started by: Bite That Apple on July 10, 2013, 02:46:50 AM

Title: URL Playsound Addon :) [2.28v]
Post by: Bite That Apple on July 10, 2013, 02:46:50 AM
URL Playsound Addon

This plugin allows you to play music to the entire server using an external url link from the INTERNETZ. This supports .mp3, .ogg, and .pls file extensions.

Please Keep Note:
If you like this addon, I would really appreciate a "Compliment" Karma which is located next to my name. That's how I know you care :)
I also understand that the ULX team restricts the "U" for module names, unless it's an official release by the ULX team themselves.
So the U in URL is not attempting to use the restricted ULX module names. Thus meaning this is not an official module by the ULX team.
You must be registered and logged in the ulx forum to see the download link which is found under the preview image


Requirements:
Ulx 3.50+
ULib 2.50+


HOW TO USE:
Type !menu and go to "Apple's Creations" and find "urlplaysound" and enter your url. It's very simple to use. You can also type !playurl INSERT_URL_HERE
Following the same instructions from above, find "urlstopsound" and press the button to stop the music for the entire server. !stopurl
*NEW*
If you want to play a url just for yourself, you can type !playurlme URL-LINK-HERE and you can stop a url for yourself by typing !stopurlme


FEATURES:


TO-DO-LIST:
Nothing


KNOWN BUGS:
Sometimes if a song is like above two minutes, the song will stop playing. I can't fix this because this is a engine problem.


Preview:
(Some pictures may be out of date.)
(http://i1044.photobucket.com/albums/b449/chaos13125/playsongxgui_zpsd0c121ea.png)(http://i1044.photobucket.com/albums/b449/chaos13125/playingsong_zpse35c92aa.png)

(http://i1044.photobucket.com/albums/b449/chaos13125/stopurlxgui_zpsac598e05.png)(http://i1044.photobucket.com/albums/b449/chaos13125/StopURL_zps6938cef8.png)

(http://i1044.photobucket.com/albums/b449/chaos13125/clientstopurl_zps5147819c.png)


DOWNLOAD LINK BELOW
You must be registered and logged in the ulx forum to see the download link which is found under the preview image
Title: Re: URL Playsound Addon :)
Post by: Decicus on July 10, 2013, 03:49:46 AM
Nice little feature here, if you don't want to use serverspace on files and then run it through ulx playsound.

I'm not in need of something like this at the moment, but someone else might be. Props to you for creating this!
Title: Re: URL Playsound Addon :)
Post by: Bite That Apple on July 10, 2013, 03:53:38 AM
Nice little feature here, if you don't want to use serverspace on files and then run it through ulx playsound.

I'm not in need of something like this at the moment, but someone else might be. Props to you for creating this!

Thank you good sir.
Title: Re: URL Playsound Addon :)
Post by: Bite That Apple on July 12, 2013, 02:16:53 AM
So, I just updated this and now you can:
!stopurl and admins can globally stop the music now.
Title: Re: URL Playsound Addon :)
Post by: PAL-18 on July 14, 2013, 12:06:32 PM
This is awesome, i was using Youtube player before but that crashes my server too much.

Any chance you can add a soundlist that remembers URL's, lets you choose a title for it and displays them in a list?
Title: Re: URL Playsound Addon :)
Post by: Bite That Apple on July 14, 2013, 12:21:39 PM
This is awesome, i was using Youtube player before but that crashes my server too much.

Any chance you can add a soundlist that remembers URL's, lets you choose a title for it and displays them in a list?

Maybe, but that's more of an addon than plugin for ulx
Title: Re: URL Playsound Addon :)
Post by: sabo on July 14, 2013, 02:38:26 PM
Sorry if this is a stupid question but before I put this on the server I would like to know if I can play youtube links?

www.youtube.com/xxxxxxxxxx

Or does the song have to be hosted on a webserver?
Title: Re: URL Playsound Addon :)
Post by: JamminR on July 14, 2013, 04:22:50 PM
Or does the song have to be hosted on a webserver?
Yep. Direct file link, no fancy flash stuff.
This supports .mp3, .ogg, and .pls file extensions.
Title: Re: URL Playsound Addon :)
Post by: PAL-18 on July 15, 2013, 02:28:20 AM
Maybe, but that's more of an addon than plugin for ulx

... Then you named your thread wrong ....  (You called it "URL Playsound Addon")
Title: Re: URL Playsound Addon :)
Post by: Bite That Apple on July 15, 2013, 04:50:08 AM
... Then you named your thread wrong ....  (You called it "URL Playsound Addon")

People who download this knows what it means. It's an addon obviously, but it's a modification for ulx. If I was to call it URL Playsound Plugin, people would think of minecraft, or none Garry's Mod related things.
Title: Re: URL Playsound Addon :)
Post by: PAL-18 on July 15, 2013, 11:43:05 AM
Oh.

Well i use ULX and i didnt know the difference between the two.  Why not put in brackets at end: (Really, its just a plugin)
Title: Re: URL Playsound Addon :)
Post by: JamminR on July 15, 2013, 02:25:35 PM
Really? You're all really going to aregue the name of the release?
Plug-in works.
Addon works.
Any person of reasonable intelligence will know, after reading the release post, that either name would work.

But, if somone must just be nit picky, then by all means, I'm going to also.
Addon/plugins written for ULX are, really, called modules.
Hence why we have a modules folder.

(and no, don't rename the post, i'm just throwing some sarcasm into the salty air)
:)
Title: Re: URL Playsound Addon :)
Post by: craigst on July 15, 2013, 06:33:02 PM
please add !starturl :) all good stoping how do u start and change volume
Title: Re: URL Playsound Addon :)
Post by: Bite That Apple on July 15, 2013, 07:53:34 PM
please add !starturl :) all good stoping how do u start and change volume

change volume is more unique system, not for this current version of this module. The other thing I can do, !playurl
Title: Re: URL Playsound Addon :)
Post by: Bite That Apple on July 15, 2013, 08:03:39 PM
Done, update
Title: Re: URL Playsound Addon 2.0 :)
Post by: craigst on July 17, 2013, 03:48:20 AM
thank you
Title: Re: URL Playsound Addon 2.0 :)
Post by: sabo on July 17, 2013, 01:05:41 PM
Complimented :D

I got a question, how many characters or letters does this command accept? Because some of my links were long and did not work, I shortened the name of the song and it worked.

Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 17, 2013, 05:11:12 PM
Complimented :D

I got a question, how many characters or letters does this command accept? Because some of my links were long and did not work, I shortened the name of the song and it worked.

If you're using !playurl, then it will accept as many characters as garry's mod chat system will allow. Though, if you're using it through XGUI (as I suggest) then it will accept unlimited characters. It might be your link that you were trying to use that wasn't working at all.
Title: Re: URL Playsound Addon 2.0 :)
Post by: sabo on July 18, 2013, 04:56:37 PM
If you're using !playurl, then it will accept as many characters as garry's mod chat system will allow. Though, if you're using it through XGUI (as I suggest) then it will accept unlimited characters. It might be your link that you were trying to use that wasn't working at all.

I use it via xgui.

My link had % and other letters in it, do they matter?

Does the size of the song matter?

I host the songs myself on my Dropbox account lol so not sure if that is the problem.
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 18, 2013, 04:59:04 PM
I use it via xgui.

My link had % and other letters in it, do they matter?

Does the size of the song matter?

I host the songs myself on my Dropbox account lol so not sure if that is the problem.

what was the end extension for the song? (i.e.  .mp3  ?)
Title: Re: URL Playsound Addon 2.0 :)
Post by: sabo on July 20, 2013, 08:08:46 AM
*.mp3


Here is an example for a link (not sure if this one worked out or not :D)

https://dl.dropboxusercontent.com/u/17573425/old%20tegload%20stuff/I%27m%20On%20One%20%28KillaGraham%20Remix%29%20Final.mp3
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 20, 2013, 08:39:23 AM
*.mp3


Here is an example for a link (not sure if this one worked out or not :D)

https://dl.dropboxusercontent.com/u/17573425/old%20tegload%20stuff/I%27m%20On%20One%20%28KillaGraham%20Remix%29%20Final.mp3

First: What's the song?
Second: It should work, but I would use bit.ly to make the link shorter.
Title: Re: URL Playsound Addon 2.0 :)
Post by: sabo on July 20, 2013, 01:05:33 PM
First: What's the song?
Second: It should work, but I would use bit.ly to make the link shorter.

I'm On One (KillaGraham Remix) Final (it say at the titel of the webpage lol?)

I found out there is a limit of characters used, so you will have to use a short URL for this :I

Anyways, good job and thanks for the addon :)
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 20, 2013, 01:07:41 PM
I'm On One (KillaGraham Remix) Final (it say at the titel of the webpage lol?)

I found out there is a limit of characters used, so you will have to use a short URL for this :I

Anyways, good job and thanks for the addon :)

Thanks and Thanks
Title: Re: URL Playsound Addon 2.0 :)
Post by: Decicus on July 21, 2013, 01:32:07 AM
Since links are set as %20 when there is a space in a filename, I recommend adding underscores where the spaces should be.
Title: Re: URL Playsound Addon 2.0 :)
Post by: LuaTenshi on July 24, 2013, 04:28:31 PM
Looks very interesting, have you considered making an entity that would be able to play sound from a URL dynamically?

Also I like your Avatar (Fruity Loops Studio)
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 24, 2013, 08:16:41 PM
Looks very interesting, have you considered making an entity that would be able to play sound from a URL dynamically?

Also I like your Avatar (Fruity Loops Studio)

Not possible, as far as I can see.
Title: Re: URL Playsound Addon 2.0 :)
Post by: nak0604 on July 29, 2013, 09:29:32 PM
This isnt showing up in my menus at all. This just goes in the addons folder correct?
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 29, 2013, 09:30:35 PM
This isnt showing up in my menus at all. This just goes in the addons folder correct?

Correct, just in the addons folder. Are you getting any errors?
Title: Re: URL Playsound Addon 2.0 :)
Post by: nak0604 on July 30, 2013, 03:00:55 PM
This is the only thing that comes up in my console when its starting that has to do with playurl

http://pastebin.com/YmaSC2WM
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 30, 2013, 03:10:38 PM
This is the only thing that comes up in my console when its starting that has to do with playurl

http://pastebin.com/YmaSC2WM

ULX has it's way loading in console. If you don't see this ULX loading, then something is wrong with your ULX.
http://puu.sh/3PKdi.png

Also, at the bottom of that picture you'll see a lines called "MODULE: " loading at the bottom, and if you don't see "MODULE: playurl.lua" or "MODULE: playthesound.lua" not loading, then something is wrong in general.
Title: Re: URL Playsound Addon 2.0 :)
Post by: nak0604 on July 30, 2013, 05:32:24 PM
ulx shows that everything is loading

ULX loading: http://pastebin.com/Tf57RynH
Title: Re: URL Playsound Addon 2.0 :)
Post by: JamminR on July 30, 2013, 06:59:20 PM
Nak, READ what Chaos said in his last post.
if you don't see "MODULE: playurl.lua" or "MODULE: playthesound.lua" not loading, then something is wrong in general.

The last bit of loading you posted does not have those modules loaded, so, no, everything is not loading for you.
Also, reports.lua is broken, no idea what it is, but it's not one of our releases..it needs to be fixed.
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 30, 2013, 08:33:20 PM
ulx shows that everything is loading

ULX loading: http://pastebin.com/Tf57RynH

Nak, READ what Chaos said in his last post.
The last bit of loading you posted does not have those modules loaded, so, no, everything is not loading for you.
Also, reports.lua is broken, no idea what it is, but it's not one of our releases..it needs to be fixed.


As JamminR has stated. This is out of my control, you must not be using an Official version of ULX (or some really old version). The current version of ULX is 3.61 and ULiB is 2.51. So if you don't have that version or the official version, then you could be running into the problem you are having.

You can download newer and official versions of ULX here -> http://ulyssesmod.net/downloads.php <-

So I would suggest deleting your current version, and download the official and newer version of ULX so plugins (modules) for ULX will work correctly.


Thanks for choosing Apple Innovations.
Title: Re: URL Playsound Addon 2.0 :)
Post by: nak0604 on July 30, 2013, 09:48:18 PM
chaos i have the latest version according the the SVN that they have
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 31, 2013, 02:00:49 AM
chaos i have the latest version according the the SVN that they have

Are you sure your using the official SVN for ulx and Ulib, if so then delete the folder and redownload it from SVN.
Title: Re: URL Playsound Addon 2.0 :)
Post by: nak0604 on July 31, 2013, 10:41:35 AM
Yes i am, i will try re-downloading it and let you know if anything changes.

EDIT:It is at revision 161, i re-downloaded ulx and ulib and it still wont load the playurl, im just going to give up on this. Thanks for attempting to help.
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on July 31, 2013, 06:45:58 PM
Yes i am, i will try re-downloading it and let you know if anything changes.

EDIT:It is at revision 161, i re-downloaded ulx and ulib and it still wont load the playurl, im just going to give up on this. Thanks for attempting to help.

Sorry to hear that it didn't work out. Well there is one last thing, if you're still up for it. Somewhere in your addons, there is a addon conflicting with ulx, or maybe in the garrysmod/lua folder itself.
Title: Re: URL Playsound Addon 2.0 :)
Post by: LuaTenshi on August 02, 2013, 10:28:25 PM
Talking about the entity I suggested in an earlier reply. It would be possible if you had it change volume based on distance, and disable if the volume is too low or some thing.
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 02, 2013, 10:32:44 PM
Talking about the entity I suggested in an earlier reply. It would be possible if you had it change volume based on distance, and disable if the volume is too low or some thing.

As far as I want to put effort into turning Garry's function into something way more.. effort forward, I see it as impossible, thus making me not want to do it.
Title: Re: URL Playsound Addon 2.0 :)
Post by: JamminR on August 03, 2013, 03:55:07 AM
Does Ent:EmitSound (http://wiki.garrysmod.com/page/Entity/EmitSound) not adjust volume as you get farther away?
Seems silly Garry would just have full volume up to 'range' then cut off.
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 03, 2013, 01:40:51 PM
Does Ent:EmitSound (http://wiki.garrysmod.com/page/Entity/EmitSound) not adjust volume as you get farther away?
Seems silly Garry would just have full volume up to 'range' then cut off.

It's been sometime since I've worked with lua now. I'm not really up to the challenge to somehow convert or modify an external url sound into a server sound, so this entity can use it without issues. Though, this is an interesting thing you've shown me 'Ent:EmitSound', maybe one day I might come back and look into it.

Lastly, (this might not really make sense to some people, but it does to me) I've never really gone into or really even tested that type of lua usage. I've always more 'favored' server side lua(and have been better at that), rather than client side. As well as an actual entity.
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 12, 2013, 10:51:07 AM
Can you guyz suggest a webpage which allow you to transfer a sound into a playable link which you can play on your server?

I tried dropbox... I cant get it to work for some reason??

Thanks :3

Edit: I tried to see If I could find a webpage "like dropbox" how transformed the mp3 to a url that acutually worked :D... I got no luck.
So if you could send me to a webpage who is making a useable link, that would make my day :)

Ps: Dont tell me to make my own webpage and host it from there :P

Thanks :D
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 12, 2013, 02:55:43 PM
Can you guyz suggest a webpage which allow you to transfer a sound into a playable link which you can play on your server?

I tried dropbox... I cant get it to work for some reason??

Thanks :3

Edit: I tried to see If I could find a webpage "like dropbox" how transformed the mp3 to a url that acutually worked :D... I got no luck.
So if you could send me to a webpage who is making a useable link, that would make my day :)

Ps: Dont tell me to make my own webpage and host it from there :P

Thanks :D

Can you send me the link to that dropbox of the song you're trying to use. Also after that, you can try to use archive.org, which is what I would use.
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 13, 2013, 04:57:25 AM
Can you send me the link to that dropbox of the song you're trying to use. Also after that, you can try to use archive.org, which is what I would use.
-snip-

I finally got it to work :D
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 14, 2013, 04:52:45 AM
-snip-

I finally got it to work :D

Glad to hear :)
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 17, 2013, 07:33:58 AM
I was wondering, This there a way that you can modify this file or create a new one which did so the "Url playsound" played a sound when the round ended... Like "end of the round music" just without the download? :D That could be really great :)..

Like you can insert a link its gonna play everytime: innocentwin/traitorswin/timesup :)

But again, A really great plugin/addon :P
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 17, 2013, 07:42:38 AM
I was wondering, This there a way that you can modify this file or create a new one which did so the "Url playsound" played a sound when the round ended... Like "end of the round music" just without the download? :D That could be really great :)..

Like you can insert a link its gonna play everytime: innocentwin/traitorswin/timesup :)

But again, A really great plugin/addon :P

Yes, that would be very easy. Though it depends how you would like it setup, because "end of round" music is someone generic. I would need the link to the sound you would want to be played, also would want to know when or how the sound is going to be played. If you answer all those factors, I may be able to assist you.
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 17, 2013, 02:05:46 PM
Hey Chaos :D You gotta know that I have no expiriance in Lua.. well not much. And it was just a "dream" That i think i would share :)

If you wanna play around with it then I have this song https://dl.dropboxusercontent.com/u/192408473/iwins53765.wav
And the sound shoud be played when a round end?

But Isn't there some functions in Lua called like this?:
Code: [Select]
if wintype == WIN_INNOCENT then:and
Code: [Select]
elseif wintype == WIN_TRAITOR then:and
Code: [Select]
elseif wintype == WIN_TIMELIMIT then:?But again :D I dont know much of what i talk about ;)

Thanks you for you help and answer :)
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 17, 2013, 02:14:34 PM
Hey Chaos :D You gotta know that I have no expiriance in Lua.. well not much. And it was just a "dream" That i think i would share :)

If you wanna play around with it then I have this song https://dl.dropboxusercontent.com/u/192408473/iwins53765.wav
And the sound shoud be played when a round end?

But Isn't there some functions in Lua called like this?:
Code: [Select]
if wintype == WIN_INNOCENT then:and
Code: [Select]
elseif wintype == WIN_TRAITOR then:and
Code: [Select]
elseif wintype == WIN_TIMELIMIT then:?But again :D I dont know much of what i talk about ;)

Thanks you for you help and answer :)

I'm assuming this is for TTT?
Title: Re: URL Playsound Addon 2.0 :)
Post by: Decicus on August 17, 2013, 02:20:34 PM
Yes, that is for TTT.
I have an example code that I made for my server if you want to use it.
(This is edited, of course, I save the files on server + fast dl).

Code: Lua
  1. --resource.AddFile("sound/endroundmusic/innocent.mp3")
  2. --resource.AddFile("sound/endroundmusic/timelimit.mp3")
  3. --resource.AddFile("sound/endroundmusic/traitor.mp3")
  4.  
  5. function EndMusic (res)
  6.         if res == WIN_INNOCENT then
  7.                 --Insert code to execute if "INNOCENTS" win the round.
  8.                 --BroadcastLua('surface.PlaySound("endroundmusic/innocent.mp3")') --Remove double dashes to uncomment, remember to uncomment the "resource.AddFile"s too. This requires you to save the sound files on the server + fast download.
  9.         elseif res == WIN_TIMELIMIT then
  10.                 --Insert code to execute if the round ends due to TIME LIMIT.
  11.                 --BroadcastLua('surface.PlaySound("endroundmusic/timelimit.mp3")') --Read comment for the "WIN_INNOCENT"
  12.         elseif res == WIN_TRAITOR then
  13.                 --Insert code to execute if the round ends due to TRAITOR WIN
  14.                 --BroadcastLua('surface.PlaySound("endroundmusic/traitor.mp3")') --Read comment for the "WIN_INNOCENT"
  15.         end
  16. end
  17. hook.Add("TTTEndRound", "EndRoundMusic", EndMusic)
  18.  
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 17, 2013, 03:44:03 PM
Yes, that is for TTT.
I have an example code that I made for my server if you want to use it.
(This is edited, of course, I save the files on server + fast dl).

Code: Lua
  1. --resource.AddFile("sound/endroundmusic/innocent.mp3")
  2. --resource.AddFile("sound/endroundmusic/timelimit.mp3")
  3. --resource.AddFile("sound/endroundmusic/traitor.mp3")
  4.  
  5. function EndMusic (res)
  6.         if res == WIN_INNOCENT then
  7.                 --Insert code to execute if "INNOCENTS" win the round.
  8.                 --BroadcastLua('surface.PlaySound("endroundmusic/innocent.mp3")') --Remove double dashes to uncomment, remember to uncomment the "resource.AddFile"s too. This requires you to save the sound files on the server + fast download.
  9.         elseif res == WIN_TIMELIMIT then
  10.                 --Insert code to execute if the round ends due to TIME LIMIT.
  11.                 --BroadcastLua('surface.PlaySound("endroundmusic/timelimit.mp3")') --Read comment for the "WIN_INNOCENT"
  12.         elseif res == WIN_TRAITOR then
  13.                 --Insert code to execute if the round ends due to TRAITOR WIN
  14.                 --BroadcastLua('surface.PlaySound("endroundmusic/traitor.mp3")') --Read comment for the "WIN_INNOCENT"
  15.         end
  16. end
  17. hook.Add("TTTEndRound", "EndRoundMusic", EndMusic)
  18.  
1) Thats were i got my code from (end of the round music addon)

2) this have nothing to do with url playsound?

3) this require that your users download your sounds
But ty :D

Because i wanna make it so its the "url playsound" that plays a link auto when a round end
So my users dont have to download the sound :)

Edit: Because when i looked at the end of the round music addon and saw how long it takes to download "10sec x 3 files" .. then i thought "why not make the url addon play the sound?" :D
Because i have no kind of FastDL because i host my server my self :P
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 17, 2013, 04:00:15 PM
Where is the file located at in TTT, because I'm not going to spend all day looking for it, as I dislike TTT anyways.
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 17, 2013, 04:25:05 PM
After viewing what you guys wrote, I realized you created your own file. So here you go:

Place this code in the init.lua file, right about the karam.lua like this
Code: [Select]
include("music.lua")
So it should look like this
Code: [Select]
include("music.lua")
include("karma.lua")
include("entity.lua")
include("scoring_shd.lua")
include("radar.lua")
include("admin.lua")
include("traitor_state.lua")
include("propspec.lua")
include("weaponry.lua")
include("gamemsg.lua")
include("ent_replace.lua")
include("scoring.lua")
include("corpse.lua")
include("player_ext_shd.lua")
include("player_ext.lua")
include("player.lua")
include("tags.lua")



Then place the music.lua file in the gamemode folder:
terrortown/gamemode/
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 18, 2013, 04:35:00 AM
After viewing what you guys wrote, I realized you created your own file. So here you go:

Place this code in the init.lua file, right about the karam.lua like this
Code: [Select]
include("music.lua")
So it should look like this
Code: [Select]
include("music.lua")
include("karma.lua")
include("entity.lua")
include("scoring_shd.lua")
include("radar.lua")
include("admin.lua")
include("traitor_state.lua")
include("propspec.lua")
include("weaponry.lua")
include("gamemsg.lua")
include("ent_replace.lua")
include("scoring.lua")
include("corpse.lua")
include("player_ext_shd.lua")
include("player_ext.lua")
include("player.lua")
include("tags.lua")



Then place the music.lua file in the gamemode folder:
terrortown/gamemode/

Hey Chaos Thanks for your work :)

But for some reason Im getting errors?
Code: [Select]
[ERROR] gamemodes/terrortown/gamemode/music.lua:5: attempt to
Player' (a nil value)
  1. fn - gamemodes/terrortown/gamemode/music.lua:5
   2. Call - addons/ulib/lua/ulib/shared/hook.lua:183
    3. EndRound - gamemodes/terrortown/gamemode/init.lua:781
     4. unknown - gamemodes/terrortown/gamemode/init.lua:302

If you dont wanna work on it because you dislike ttt then just tell me :D you have already been so helpfull :)
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 18, 2013, 04:36:25 AM
Mmhhhh, I have a fix for that. Just give this post about five minutes, and I'll edit it this post with the updated music.lua
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 18, 2013, 04:57:50 AM
Okay, so I completely change the init setup from before.

Now in the init.lua, find:
Code: [Select]
AddCSLuaFile("karma.lua")
Which can be found in this row of includes:
Code: [Select]
include("karma.lua")
include("entity.lua")
include("scoring_shd.lua")
include("radar.lua")
include("admin.lua")
include("traitor_state.lua")
include("propspec.lua")
include("weaponry.lua")
include("gamemsg.lua")
include("ent_replace.lua")
include("scoring.lua")
include("corpse.lua")
include("player_ext_shd.lua")
include("player_ext.lua")
include("player.lua")
include("tags.lua")
In that file, add this above the include("karma.lua"):
Code: [Select]
include("music.lua")
Also, add:
Code: [Select]
AddCSLuaFile("music.lua")under
Code: [Select]
AddCSLuaFile("vgui/sb_info.lua")
So now it should look something like this like this:
Code: [Select]
AddCSLuaFile("vgui/sb_main.lua")
AddCSLuaFile("vgui/sb_row.lua")
AddCSLuaFile("vgui/sb_team.lua")
AddCSLuaFile("vgui/sb_info.lua")
AddCSLuaFile("music.lua")

include("resources.lua")
include("shared.lua")

include("music.lua")
include("karma.lua")
include("entity.lua")
include("scoring_shd.lua")
include("radar.lua")
include("admin.lua")
include("traitor_state.lua")
include("propspec.lua")
include("weaponry.lua")
include("gamemsg.lua")
include("ent_replace.lua")
include("scoring.lua")
include("corpse.lua")
include("player_ext_shd.lua")
include("player_ext.lua")
include("player.lua")
include("tags.lua")



-----


Now goto the cl_init.lua file and find:
Code: [Select]
include("cl_radio.lua")which can be found in:
Code: [Select]
include("cl_radio.lua")
include("cl_disguise.lua")
include("cl_transfer.lua")
include("cl_targetid.lua")
include("cl_search.lua")
include("cl_radar.lua")
include("cl_tbuttons.lua")
include("cl_scoreboard.lua")
include("cl_tips.lua")
include("cl_help.lua")
include("cl_hud.lua")
include("cl_msgstack.lua")
include("cl_hudpickup.lua")
include("cl_keys.lua")
include("cl_wepswitch.lua")
include("cl_scoring.lua")
include("cl_scoring_events.lua")
include("cl_popups.lua")
include("cl_equip.lua")
include("cl_voice.lua")


Above the this code:
Code: [Select]
include("cl_radio.lua")add this code:
Code: [Select]
include("music.lua")
So now it should look like this:
Code: [Select]
include("music.lua")
include("cl_radio.lua")
include("cl_disguise.lua")
include("cl_transfer.lua")
include("cl_targetid.lua")
include("cl_search.lua")
include("cl_radar.lua")
include("cl_tbuttons.lua")
include("cl_scoreboard.lua")
include("cl_tips.lua")
include("cl_help.lua")
include("cl_hud.lua")
include("cl_msgstack.lua")
include("cl_hudpickup.lua")
include("cl_keys.lua")
include("cl_wepswitch.lua")
include("cl_scoring.lua")
include("cl_scoring_events.lua")
include("cl_popups.lua")
include("cl_equip.lua")
include("cl_voice.lua")



---




Lastly, download the new music.lua and replace it with the old one I gave you. So if it was done correctly, your init.lua file should look something like this

(http://puu.sh/44I6M.png)

and your cl_init.lua should look like:

(http://puu.sh/44I6U.png)
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 18, 2013, 07:15:47 AM
**A Awesome support guide :D**
Just to long to reply on :)

Thanks for the great guide you gave :D I did everythink you said about init and cl_init
And that should be okay now...
But im still getting lua errors?

Code: [Select]
[ERROR] gamemodes/terrortown/gamemode/music.lua:32: 'end' expected (to close 'if
' at line 19) near '<eof>'
  1. unknown - gamemodes/terrortown/gamemode/music.lua:0
I dont know if it's just a "end" i need somewere?

But again thanks for the great and awesome support :) very helpfull and is much apreciated :)
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 18, 2013, 07:19:21 AM
Thanks for the great guide you gave :D I did everythink you said about init and cl_init
And that should be okay now...
But im still getting lua errors?

Code: [Select]
[ERROR] gamemodes/terrortown/gamemode/music.lua:32: 'end' expected (to close 'if
' at line 19) near '<eof>'
  1. unknown - gamemodes/terrortown/gamemode/music.lua:0
I dont know if it's just a "end" i need somewere?

But again thanks for the great and awesome support :) very helpfull and is much apreciated :)

at the bottom of the file it most likely says
Code: [Select]
end
hook.Add("TTTEndRound", "EndRoundMusic", EndMusic)
end

just add another "end" at the bottom so it says
Code: [Select]
end
hook.Add("TTTEndRound", "EndRoundMusic", EndMusic)
end
end
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 18, 2013, 07:50:33 AM
at the bottom of the file it most likely says
Code: [Select]
end
hook.Add("TTTEndRound", "EndRoundMusic", EndMusic)
end

just add another "end" at the bottom so it says
Code: [Select]
end
hook.Add("TTTEndRound", "EndRoundMusic", EndMusic)
end
end
[/quote

I think it works now... hmm.. Its not giving me any lua-error :D... I will return with more info later :)

But you chaos needs a big "thanks you so freaking much!" like 1000 times :)
I love your work so keep it up :)
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 18, 2013, 08:59:55 AM
Thanks I try. I hope it works out for you.
Title: Re: URL Playsound Addon 2.0 :)
Post by: PotatoPanMan on August 20, 2013, 05:52:01 PM
I tested this with my friends. They can't hear the sound when I play it.
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 20, 2013, 09:12:13 PM
I tested this with my friends. They can't hear the sound when I play it.

(no offense, but I hate when people tell me something is wrong with something, though they don't give any information)

Can you please provide me the link you're trying to use.
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on August 24, 2013, 11:10:48 AM
Hey Chaos, This is just a suggestion that can "maybe" inprove your addon/plugin.

What if you added somekind of !starturl ?
so a single client start to listin to a listed link of songs?

Because i can see a lot of my players type !starturl.... and i dont know why :3
I havn't told them there is a command called !starturl :D

But nvm :D Its just a suggestion you can use if your intressed :P
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on August 24, 2013, 03:27:43 PM
Hey Chaos, This is just a suggestion that can "maybe" inprove your addon/plugin.

What if you added somekind of !starturl ?
so a single client start to listin to a listed link of songs?

Because i can see a lot of my players type !starturl.... and i dont know why :3
I havn't told them there is a command called !starturl :D

But nvm :D Its just a suggestion you can use if your intressed :P

I never really imagined the thought of that actually. That's a very nice suggestion. I'll import it later this weekend.
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on September 02, 2013, 06:48:17 AM
I never really imagined the thought of that actually. That's a very nice suggestion. I'll import it later this weekend.
Hey Chaos, I just wanna to hear if there is any progress? Since this thread have been dead for a while and im excited like a child :D
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on September 02, 2013, 11:59:22 AM
Hey Chaos, I just wanna to hear if there is any progress? Since this thread have been dead for a while and im excited like a child :D

It wouldn't be hard to do, it would take me about ten minutes to be honest. I just haven't started it because I've been busy with school work, and I forgot about it till just now. So thank you for reminding me, I'll have the attachment ready in like a few after this post.

*Reminder: I don't have garry's mod installed, so I'm just going to do this by hand and eye. So if it doesn't work at first, sorry, just tell me the error and I'll fix it.*

EDIT:
Okay, it's out now. You can download it from the first page attachments
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on September 04, 2013, 07:37:44 AM
It wouldn't be hard to do, it would take me about ten minutes to be honest. I just haven't started it because I've been busy with school work, and I forgot about it till just now. So thank you for reminding me, I'll have the attachment ready in like a few after this post.

*Reminder: I don't have garry's mod installed, so I'm just going to do this by hand and eye. So if it doesn't work at first, sorry, just tell me the error and I'll fix it.*

EDIT:
Okay, it's out now. You can download it from the first page attachments

Hey chaos :D thanks for to make this :D..
but lets cut the the case :D Im getting luaerror and thought you should know

Code: [Select]
[ERROR] addons/ulx playurl/lua/ulx/modules/sh/playurl.lua:50: 'end' expected (to
 close 'function' at line 36) near '<eof>'
  1. unknown - addons/ulx playurl/lua/ulx/modules/sh/playurl.lua:0
I guess i just have to add a "end" after the hook?

Edit: It dosn't seem like i can use the command at all? i get no errors and there is no command called !playurlme ?
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on September 04, 2013, 03:46:55 PM
Hey chaos :D thanks for to make this :D..
but lets cut the the case :D Im getting luaerror and thought you should know

Code: [Select]
[ERROR] addons/ulx playurl/lua/ulx/modules/sh/playurl.lua:50: 'end' expected (to
 close 'function' at line 36) near '<eof>'
  1. unknown - addons/ulx playurl/lua/ulx/modules/sh/playurl.lua:0
I guess i just have to add a "end" after the hook?

Edit: It dosn't seem like i can use the command at all? i get no errors and there is no command called !playurlme ?

I fixed it, you can redownload the new version.
Title: Re: URL Playsound Addon 2.0 :)
Post by: morten7000 on September 06, 2013, 05:52:43 AM
I fixed it, you can redownload the new version.
Hey chaos, sorry for the long waiting period between me answering you... Im also kinda busy with high school :D

But the same problem as befor is still there? There is no command called "!starturlme" ?
Its just like writing normally. There is no errors or signs on its a command :)
Title: Re: URL Playsound Addon 2.0 :)
Post by: Bite That Apple on September 06, 2013, 08:10:53 AM
Okay, this time to save time I have gone into garry's mod and tested it. I ended up founding out that I didn't put a "!" in the script. I have fixed it, and have reuploaded it to ulx's forum, which you can now download.
Title: Re: URL Playsound Addon 2.2 :)
Post by: morten7000 on September 06, 2013, 09:02:53 AM
Waow nice chaos :)
It had to be a pain in the ass to realize it was that :P
Ill test it later today and give you some feedback :) until that i will keep spam the "give good karma" under your name thingy :P

Nice work :)
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on September 06, 2013, 11:19:35 AM
Thank you, that really helps me out.
Title: Re: URL Playsound Addon 2.2 :)
Post by: morten7000 on September 06, 2013, 12:48:40 PM
Thank you, that really helps me out.
Chaos did you get this version to work? because I still have the same problem... Gimme a sec.. Im gonna see if it realy true that i cant get it to work :)

and have reuploaded it to ulx's forum, which you can now download.
wait. when you write like this. You mean... ehmm.. its still this thread you have to download it from.. right? :3.. kinda confused now :P... im not that famillia with ulysses.forums yet :)
Title: Re: URL Playsound Addon 2.2 :)
Post by: Decicus on September 06, 2013, 12:55:28 PM
Chaos did you get this version to work? because I still have the same problem... Gimme a sec.. Im gonna see if it realy true that i cant get it to work :)
 wait. when you write like this. You mean... ehmm.. its still this thread you have to download it from.. right? :3.. kinda confused now :P... im not that famillia with ulysses.forums yet :)

He means the original download from the first post of this thread.
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on September 06, 2013, 02:35:10 PM
Which can found here
http://forums.ulyssesmod.net/index.php?action=dlattach;topic=6429.0;attach=630 (http://forums.ulyssesmod.net/index.php?action=dlattach;topic=6429.0;attach=630)
Title: Re: URL Playsound Addon 2.2 :)
Post by: morten7000 on September 07, 2013, 05:47:02 AM
shet :D ehmm..
I think im having so problems here :P
I cant get !starturlme and !stopurl to work? huh? :3
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on September 07, 2013, 12:15:21 PM
shet :D ehmm..
I think im having so problems here :P
I cant get !starturlme and !stopurl to work? huh? :3

all i can say is that's wierd
Title: Re: URL Playsound Addon 2.2 :)
Post by: morten7000 on September 07, 2013, 02:18:03 PM
all i can say is that's wierd
I can only agree my good sir :3
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on September 07, 2013, 06:25:10 PM
I can only agree my good sir :3

I don't know what to tell you, it's working on my end. Did you not delete the old files or something?
Title: Re: URL Playsound Addon 2.2 :)
Post by: morten7000 on September 08, 2013, 07:00:34 AM
Waow im stupid...
I noticed that you have changed the commands for the addon..
so long so good :D
but now another problem have gotton to me..
It seems when i type !stopurlme it stops the music from the whole server and when i type !stopurl, nothings happen?
but the !playurlme and !playurl works fine :P

Plz tell me if !stopurl and !stopurlme works on your end as it should.. Because it could be me thats stupid  again :P

Edit: okay i change line 31 from
Code: [Select]
ulx.stopurlsound, "!stopurlme" to
Code: [Select]
ulx.stopurlsound, "!stopurl"that seems to get !stopurl to work as it should, now i just need the !stopurlme ? :D
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on September 08, 2013, 02:45:48 PM
Waow im stupid...
I noticed that you have changed the commands for the addon..
so long so good :D
but now another problem have gotton to me..
It seems when i type !stopurlme it stops the music from the whole server and when i type !stopurl, nothings happen?
but the !playurlme and !playurl works fine :P

Plz tell me if !stopurl and !stopurlme works on your end as it should.. Because it could be me thats stupid  again :P

Edit: okay i change line 31 from
Code: [Select]
ulx.stopurlsound, "!stopurlme" to
Code: [Select]
ulx.stopurlsound, "!stopurl"that seems to get !stopurl to work as it should, now i just need the !stopurlme ? :D

okay, okay, everything is fixed. I tested it, and had others test it while I was working on it. It should work 101% fine now.
Title: Re: URL Playsound Addon 2.2 :)
Post by: morten7000 on September 09, 2013, 04:47:14 AM
okay, okay, everything is fixed. I tested it, and had others test it while I was working on it. It should work 101% fine now.
Sounds great chaos :D sorry for being so harss on you :)
But im glad you got it to work :)
Title: Re: URL Playsound Addon 2.2 :)
Post by: night650 on September 30, 2013, 10:55:44 PM
Where do i insert this module? im having difficulty with it.
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on October 01, 2013, 12:11:10 AM
Where do i insert this module? im having difficulty with it.

you put the entire unzipped folder in the addons folder :p
Title: Re: URL Playsound Addon 2.2 :)
Post by: theexcel on October 04, 2013, 03:43:22 PM
Is there a way to have the music play only for select users or groups? The only idea I have is to have the music play with the normal playurl command and then use cexec on players I don't want hearing it to force them to say "!stopurlme" in chat.
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on October 04, 2013, 03:50:45 PM
Is there a way to have the music play only for select users or groups? The only idea I have is to have the music play with the normal playurl command and then use cexec on players I don't want hearing it to force them to say "!stopurlme" in chat.

Yeah it's possible with the IsUserGroup thing..
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on November 12, 2014, 06:57:52 PM
Updated All Plugins:
I updated all files/folder names to lowercase and underscores so that we won't have a problem with linux based server.

Special Thanks to Princess Twilight Sparkle
Title: Re: URL Playsound Addon 2.2 :)
Post by: MiscumMax on December 01, 2014, 05:42:55 AM
thanks :D I need it
Title: Re: URL Playsound Addon 2.2 :)
Post by: Binary on December 23, 2014, 10:17:33 AM
Kinda hard to find an URL that would work, since it doesn't load YouTube....
Title: Re: URL Playsound Addon 2.2 :)
Post by: JamminR on December 23, 2014, 03:51:04 PM
Kinda hard to find an URL that would work, since it doesn't load YouTube....
Oh?
If you don't have your own web server to host sound files on, then, Google turned up some results QUICK for me.
https://archive.org/download/testmp3testfile/mpthreetest.mp3 <- silly-but, just goes to show they're out there and quickly found if you don't have your own hosting site.
Could probably turn a shoutcast.com m3u into a pls too, but I've no idea if PlayURL does "live" streams rather than just files.
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on December 25, 2014, 11:17:38 PM
Kinda hard to find an URL that would work, since it doesn't load YouTube....

This addon here is what you're looking for to play Youtube Videos. It has been around for seeminglessly, forever. It will do what you request.
https://steamcommunity.com/sharedfiles/filedetails/?id=106516163
Title: Re: URL Playsound Addon 2.2 :)
Post by: jamm0 on January 02, 2015, 06:30:51 AM
Is there a way to make this opt-in instead of opt-out and keep a list of those that opted in, so when a mapchange occurs it won't get reset? Thanks
Title: Re: URL Playsound Addon 2.2 :)
Post by: ChosenOne on January 02, 2015, 03:04:05 PM
You could do what I did and create a client side convar and add a place for the player to change that convar (since I'm doing TTT I added it to the F1 menu). Then when the playURL command is run, you create a filter, loop through all the players, add each player that has their convar set to hear the sound to the filter, and finally send the filter to the playURL command. This will make only the people who have opted in to hear the sounds and it will stay over map changes.
Title: Re: URL Playsound Addon 2.2 :)
Post by: richlen99 on January 15, 2015, 07:07:44 PM
it seems that on my server, the sound stops after like ~2/3 mins....possible bug?
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on January 15, 2015, 08:31:11 PM
it seems that on my server, the sound stops after like ~2/3 mins....possible bug?

If that's a bug, then I can't fix it, it's a Garry's Mod bug. I'll test it out though, can you tell me what link you're using to play music?
Title: Re: URL Playsound Addon 2.2 :)
Post by: Bite That Apple on February 03, 2015, 11:29:42 PM
Updated addon to current system!
Title: Re: URL Playsound Addon :) [2.25v]
Post by: Vertey on February 28, 2015, 10:39:55 AM
I play music and i don't her it's and on chat is "vertey played .........."
Title: Re: URL Playsound Addon :) [2.25v]
Post by: Bite That Apple on February 28, 2015, 06:58:03 PM
I play music and i don't her it's and on chat is "vertey played .........."

if the url is more than 256 characters long it will not work, if it doesn't have a file extension towards the end of the link it will not work.. though because you didn't really give me any more details, I can't assist you.
Title: Re: URL Playsound Addon :) [2.26v]
Post by: Ricoben3 on March 11, 2015, 11:36:13 AM
Would it be possible to create some sort of list that saves previously played files so that they are easily referred to, kind of like how slay or kick and stuff has of list of people on the server. Just so that we don't have to type it in every time?
Title: Re: URL Playsound Addon :) [2.26v]
Post by: Bite That Apple on March 11, 2015, 06:18:01 PM
Would it be possible to create some sort of list that saves previously played files so that they are easily referred to, kind of like how slay or kick and stuff has of list of people on the server. Just so that we don't have to type it in every time?

As far as I see it, that is not possible within ulx, it would have to be an outside addon, or maybe within xgui, but idk how to use xgui.
Title: Re: URL Playsound Addon :) [2.26v]
Post by: Bite That Apple on March 12, 2015, 09:22:17 PM
Something terrible has happened with all my addons, so it's going to take me a few days to get them all fixed, as you may now experience issues due to this:
http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html (http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html)
Title: Re: URL Playsound Addon :) [2.27v]
Post by: allofmywutsteam on March 21, 2015, 03:33:53 PM
Finally got it to work. Didn't realize it had to be on a hosted server. Luckily NFo gives you one, for anyone curious. So just upload it to the website and your good. Then run the direct link to bit.ly if needed

Also, I'm trying to bind a key to play a sound, but bind mess up at http:

bind 9 "ulx urlplaysound http://bit.ly/1BjN6Mr (http://bit.ly/1BjN6Mr)" and different variations seem to not work
Title: Re: URL Playsound Addon :) [2.27v]
Post by: JamminR on March 21, 2015, 04:25:37 PM
Finally got it to work. Didn't realize it had to be on a hosted server.<clip>
bind 9 "ulx urlplaysound h1tp://bit.ly/1BjN6Mr]http://bit.ly/1BjN6Mr" and different variations seem to not work
Not sure why you didn't know it had to be hosted.
put the url in quotes ulx playsound "your:URL" - though, yes, you may have trouble doing that in console if you don't know how to escape them out.
The original post and few conversations later in thread state that you have to link to a internet URL.
Also, the file link has to end in a supported file extension of .mp3, .ogg, .pls,
Whatever you're trying to use doesn't end in one of those. (Though, it does redirect, I'd guess that Gmod http.Fetch won't allow redirects, nothing the author can do to fix that)
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 27, 2015, 10:57:13 AM
Hey guys, I am in need of a little help with two things:
1) I am trying to implement an "auto-silence" of all sound being played via !playurl  at the end of the round. While it works, the console is throwing script errors out that say the following:
Code: Text
  1. [ERROR] addons/ulx/lua/ulx/modules/sh/playurl.lua:143: attempt to index global 'umsg' (a nil value)
  2.   1. fn - addons/ulx/lua/ulx/modules/sh/playurl.lua:143
  3.    2. Call - addons/ulib/lua/ulib/shared/hook.lua:105
  4.     3. RoundStateChange - gamemodes/terrortown/gamemode/cl_init.lua:129
  5.      4. func - gamemodes/terrortown/gamemode/cl_init.lua:204
  6.       5. unknown - lua/includes/modules/net.lua:32


These are the lines of code I added starting at line 143
Code: Lua
  1. umsg.Start("ulib_url_stopsound")
  2.         umsg.String(stopurlsound)
  3. umsg.End()
I do not understand why it keep saying that it is a nil value....

2)   I am also trying to implement code to prevent a new song from playing while a song is already playing. (using !stopurl, then !playurl again would be the way to do a new song)

If any of you guys have insight on the matter, feel free to reply to this or email me at stealthycow369@hotmail.com

Thanks
Title: Re: URL Playsound Addon :) [2.27v]
Post by: allofmywutsteam on March 27, 2015, 11:12:41 AM
Not sure why you didn't know it had to be hosted.
put the url in quotes ulx playsound "your:URL" - though, yes, you may have trouble doing that in console if you don't know how to escape them out.
The original post and few conversations later in thread state that you have to link to a internet URL.
Also, the file link has to end in a supported file extension of .mp3, .ogg, .pls,
Whatever you're trying to use doesn't end in one of those. (Though, it does redirect, I'd guess that Gmod http.Fetch won't allow redirects, nothing the author can do to fix that)

How do I "escape it out" then? because I'm pretty sure I've run:

bind 9 "ulx playurlsound http://monicasnwo.site.nfoservers.com/server/music/swag.mp3 (http://monicasnwo.site.nfoservers.com/server/music/swag.mp3)"
bind 9 ulx playurlsound "http://monicasnwo.site.nfoservers.com/server/music/swag.mp3"

And neither have worked (I'll double check). When I press the 9 after binding it, it seems to recognize the bind, but it stops at "http:" and doesn't play anything. Keep in mind this is only an issue when trying to bind. The command itself via xgui or say works fine. I've always seen this when trying to bind an http link or when I paste an http via global console. Maybe I'll post a separate post on how to accomplish this?

Anyway, it's hosted, direct link to the sound play file, ends in mp3, and file plays normally via xgui and chat so that's not the issue. It's just console recognizing the URL when the bind is run.

And I understood that it has to be an internet URL. That's not the point I was trying to make.
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Bite That Apple on March 27, 2015, 08:46:09 PM
Hey guys, I am in need of a little help with two things:
1) I am trying to implement an "auto-silence" of all sound being played via !playurl  at the end of the round. While it works, the console is throwing script errors out that say the following:
Code: Text
  1. [ERROR] addons/ulx/lua/ulx/modules/sh/playurl.lua:143: attempt to index global 'umsg' (a nil value)
  2.   1. fn - addons/ulx/lua/ulx/modules/sh/playurl.lua:143
  3.    2. Call - addons/ulib/lua/ulib/shared/hook.lua:105
  4.     3. RoundStateChange - gamemodes/terrortown/gamemode/cl_init.lua:129
  5.      4. func - gamemodes/terrortown/gamemode/cl_init.lua:204
  6.       5. unknown - lua/includes/modules/net.lua:32


These are the lines of code I added starting at line 143
Code: Lua
  1. umsg.Start("ulib_url_stopsound")
  2.         umsg.String(stopurlsound)
  3. umsg.End()
I do not understand why it keep saying that it is a nil value....

2)   I am also trying to implement code to prevent a new song from playing while a song is already playing. (using !stopurl, then !playurl again would be the way to do a new song)

If any of you guys have insight on the matter, feel free to reply to this or email me at stealthycow369@hotmail.com

Thanks

I honestly pretty sure what this was discussed already in somewhere in this thread, try searching
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 28, 2015, 11:51:55 AM
I honestly pretty sure what this was discussed already in somewhere in this thread, try searching

I went and sifted through all 7 pages of comments and was unable to find the answer to my two questions.  One came close with respect to forcing the music to stop at the end of each round; however, it was not applicable to what I am attempting to accomplish.  I need to be able to globally call stopurlsound without the use of a person calling the !stopurl command.  Whenever I do so , it gives the error message "attempt to index global "umsg" (a nil value) as referenced in my previous comment  :-\

Also, what about keeping a song playing even when someone else tries to start another song? (prevent interruptions)

Thanks :)
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Bite That Apple on March 28, 2015, 02:16:27 PM
I went and sifted through all 7 pages of comments and was unable to find the answer to my two questions.  One came close with respect to forcing the music to stop at the end of each round; however, it was not applicable to what I am attempting to accomplish.  I need to be able to globally call stopurlsound without the use of a person calling the !stopurl command.  Whenever I do so , it gives the error message "attempt to index global "umsg" (a nil value) as referenced in my previous comment  :-\

Also, what about keeping a song playing even when someone else tries to start another song? (prevent interruptions)

Thanks :)

Okay well to answer the first thing

Code: Lua
  1. umsg.Start("ulib_url_stopsound")
  2.         umsg.String(stopurlsound)
  3. umsg.End()

stopurlsound is a variable, so what do you have stopurlsound equaling to ?

Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 28, 2015, 04:12:40 PM
It's part of the ulx command
local stopurlsound = ulx.command( CATEGORY_NAME, "ulx stopurlsound", ulx.stopurlsound, "!stopurl" )
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Aaron113 on March 28, 2015, 10:11:36 PM
Looks like you're trying to send the client the command table.  That will never work, assuming you can even access it from within the command function.  You have to pass an actual string through.  So set a variable equal to what ever URL you need and pass it through there and you should be fine.
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 29, 2015, 10:17:00 AM
Looks like you're trying to send the client the command table.  That will never work, assuming you can even access it from within the command function.  You have to pass an actual string through.  So set a variable equal to what ever URL you need and pass it through there and you should be fine.

The code I have displayed here works, it's what is used to stop the music by typing "!stopurl" (provided you are an admin)  It's not its functionality that I question.  I just do not understand why is will not work without a calling_ply.
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Aaron113 on March 29, 2015, 10:35:47 AM
The code I have displayed here works, it's what is used to stop the music by typing "!stopurl" (provided you are an admin)  It's not its functionality that I question.  I just do not understand why is will not work without a calling_ply.
Code: Lua
  1. function ulx.stopurlsound( calling_ply, stopurlsound )
  2.  
  3.         umsg.Start("ulib_url_stopsound")
  4.                 umsg.String(stopurlsound)
  5.         umsg.End()
  6.  
  7.         ulx.fancyLogAdmin( calling_ply, "#A stopped the url song for the server." )
  8. end
  9.  
  10. local stopurlsound = ulx.command( CATEGORY_NAME, "ulx stopurlsound", ulx.stopurlsound, "!stopurl" )
  11. stopurlsound:defaultAccess( ULib.ACCESS_ADMIN )
  12. stopurlsound:help( "Stops a URL song for the server - !stopurl" )

You mean why calling_ply is in the parameter?  All commands run functions that way.  It's so you can see who is running the command.  You don't have to use it.  If you remove calling_ply, then stopurlsound will be equal to the player running the command.

Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 29, 2015, 01:52:00 PM
Code: Lua
  1. function ulx.stopurlsound( calling_ply, stopurlsound )
  2.  
  3.         umsg.Start("ulib_url_stopsound")
  4.                 umsg.String(stopurlsound)
  5.         umsg.End()
  6.  
  7.         ulx.fancyLogAdmin( calling_ply, "#A stopped the url song for the server." )
  8. end
  9.  
  10. local stopurlsound = ulx.command( CATEGORY_NAME, "ulx stopurlsound", ulx.stopurlsound, "!stopurl" )
  11. stopurlsound:defaultAccess( ULib.ACCESS_ADMIN )
  12. stopurlsound:help( "Stops a URL song for the server - !stopurl" )

You mean why calling_ply is in the parameter?  All commands run functions that way.  It's so you can see who is running the command.  You don't have to use it.  If you remove calling_ply, then stopurlsound will be equal to the player running the command.

I understand what you are saying; however, I fixed my predicament by using another method as follows:
Code: Lua
  1. if SERVER then
  2.         local function stopsound()
  3.                 ULib.consoleCommand( "ulx stopurlsound" .. "\n" )
  4.         end
  5.  
  6.  
  7.         hook.Add ( "TTTPrepareRound", "serverstopgents", stopsound )
  8. end

All it does is at the beginning of each round forces the server to run a command on the server console "ulx stopurlsound"
Phew, the "If server then" was also something that i forgot to put in and was throwing more errors then I would have liked.
The code I have just given, if added to the end of playurl.lua will automatically end any song playing at the beginning of the Preparing round in TTT.
Thanks for your guidance Aaron and Apple.  ;D
Title: Re: URL Playsound Addon :) [2.27v]
Post by: TeamEnternode on March 30, 2015, 05:04:21 AM
So I wanted to bind playing a url to a key, however the URL seems to be required to be encased in quotes.

Thing is, since the command obviously has spaces in it, so does the bind.

That would lead into the seemingly logical bind command being

bind kp_end "ulx playurlsound "http://www.yougetthepoint.com/""

That doesn't work, because the only thing that would be seen is

"ulx playsoundurl "

Is there a workaround for this?

EDIT: Seems something like this was mentioned however I cannot find it's answer
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Decicus on March 30, 2015, 06:08:03 AM
So I wanted to bind playing a url to a key, however the URL seems to be required to be encased in quotes.

Thing is, since the command obviously has spaces in it, so does the bind.

That would lead into the seemingly logical bind command being

bind kp_end "ulx playurlsound "http://www.yougetthepoint.com/""

That doesn't work, because the only thing that would be seen is

"ulx playsoundurl "

Is there a workaround for this?

EDIT: Seems something like this was mentioned however I cannot find it's answer
Try using single quotes instead and see if that works?
Title: Re: URL Playsound Addon :) [2.27v]
Post by: TeamEnternode on March 30, 2015, 12:56:09 PM
I tried that. It doesn't work.
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 30, 2015, 01:06:22 PM
I tried that. It doesn't work.

bind key "ulx playurlsound soundfile.mp3"
Title: Re: URL Playsound Addon :) [2.27v]
Post by: JamminR on March 30, 2015, 03:19:53 PM
Cow, that won't work, it has to be a URL... http://blah (http://blah) blah

The quotes are only a tiny bit, if at all, of your challenge.
The console is tricky in and of itself, as colon (:) means "start new command on same line".
So, typing say hello : say world in console would end up you saying in chat
<you>: hello
<you>: world

Try, with no guarantees from me;
bind 9 "ulx playurlsound http\://monicasnwo.site.nfoservers.com/server/music/swag.mp3"
That extra \ in front of the colon is an escape sequences in lua, I forget if they work exact same way in Source console.
Escape sequences tell code to not 'interpret' the next character as it normally would.
I forget what can be used in console.
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Decicus on March 30, 2015, 04:58:34 PM
Try, with no guarantees from me;
bind 9 "ulx playurlsound http\://monicasnwo.site.nfoservers.com/server/music/swag.mp3"
That extra \ in front of the colon is an escape sequences in lua, I forget if they work exact same way in Source console.
Escape sequences tell code to not 'interpret' the next character as it normally would.
I forget what can be used in console.
I tested earlier with escaping quotes in a bind. No luck. Not sure if other characters are possible.

I tried that. It doesn't work.
I wonder if it's possible for you to use a console alias for this. If the colon is a problem, then this might not even work, but give it a try.
Code: [Select]
alias soundurl "http://www.example.com/example.mp3"
Code: [Select]
bind kp_end "ulx playurlsound soundurl"
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 30, 2015, 07:12:09 PM
Decicus
 If you modify the umsg string value you can get away with jsut using song.mp3 in the bind
If you have a server that you host things off of, just change the line that says:
    umsg.String(urlsound)
 to umsg.String("http://domainname.serverhostname.com/sounddirectory/" .. urlsound)
my example is:
     umsg.String("http://buttontoucher.site.nfoservers.com/server/sound/" .. urlsound)
Then the bind command I gave you will work
If you don't have a server to host the songs/music from then my way will not work.
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Decicus on March 30, 2015, 07:14:51 PM
Decicus
 If you modify the umsg string value you can get away with jsut using song.mp3 in the bind
If you have a server that you host things off of, just change the line that says:
    umsg.String(urlsound)
 to umsg.String("http://domainname.serverhostname.com/sounddirectory/" .. urlsound)
my example is:
     umsg.String("http://buttontoucher.site.nfoservers.com/server/sound/" .. urlsound)
Then the bind command I gave you will work
If you don't have a server to host the songs/music from then my way will not work.
The addon is setup so you're supposed to provide the full URL. This way it supports more than one domain (and directory). Surely your method would work, but it's not ideal if he wants to play from different sources as well.
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Stealthycow on March 30, 2015, 07:49:27 PM
Agreed, I just wanted to provide you with an opportunity to bind the command to a key
Title: Re: URL Playsound Addon :) [2.27v]
Post by: Bite That Apple on March 31, 2015, 04:12:21 PM
I would have to use like http.post to search the entire directory, and grab all songs from that putting it in a listing.
Title: Re: URL Playsound Addon :) [2.28v]
Post by: tianight on June 25, 2015, 03:48:24 PM
I added this to my files and it showed up great , but none of the URL's are working that I choose. Am I doing something wrong or is it just not updated?
Title: Re: URL Playsound Addon :) [2.28v]
Post by: JamminR on June 25, 2015, 07:59:52 PM
tianight, I think you have to link directly to gmod compatible sounds
http://blah.blah/song.mp3 (http://blah.blah/song.mp3)
(but, I'd have to review the past few pages to verify my memory is serving me)

Are you trying URLs like that?
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Qwerty-Space on October 30, 2015, 05:18:49 PM
Perhaps you should add in the OP that it supports .wav files, because I tested on and it worked.  Also, would it be possible for the plugin to say how long the audio clip is in the chat?
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Bite That Apple on November 03, 2015, 01:34:17 PM
Perhaps you should add in the OP that it supports .wav files, because I tested on and it worked.  Also, would it be possible for the plugin to say how long the audio clip is in the chat?

To my knowledge, no, it is not possible.
Title: Re: URL Playsound Addon :) [2.28v]
Post by: JamminR on November 03, 2015, 08:40:00 PM
To my knowledge, no, it is not possible.
I don't have a working Gmod instance installed atm, but I wonder if you could use SoundDuration (http://wiki.garrysmod.com/page/Global/SoundDuration) on a URL instead of a local path. (though wiki does say 'wav' only likely)
I'm betting NOT, but, heck, worth a shot. worst that would happen is ...click....*BOOM*
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Bite That Apple on November 04, 2015, 10:17:01 PM
I don't have a working Gmod instance installed atm, but I wonder if you could use SoundDuration (http://wiki.garrysmod.com/page/Global/SoundDuration) on a URL instead of a local path. (though wiki does say 'wav' only likely)
I'm betting NOT, but, heck, worth a shot. worst that would happen is ...click....*BOOM*

Sadly, same issue here. I haven't had internet for months now, the only time I have internet is when I come on here and there using my laptop at a friends house, or if I decide to use a hotspot, though typically I just check my email and then get off. I forget to check this every so often, but I realized that sometimes people comment on my stuff...

Anywho, I could try that if I remember to try that whenever I get internet back.. (most likely will forget, and anyone who cares enough can try themselves.)
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Jakebeany500 on April 04, 2016, 08:40:45 AM
If you have a URL that is too long (as some people have seem to have had), why don't you just use a website like TinyURL.com, i had incredibly long URLs, but i used this and they work fine.
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Alemismun on April 19, 2016, 06:18:26 AM
Im new here, how to install?
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Adrien3406 on October 30, 2016, 04:39:03 AM
I have a problem, the sound stop after 1 or 2 minutes. Why please?
Title: Re: URL Playsound Addon :) [2.28v]
Post by: JamminR on October 30, 2016, 07:01:25 AM
I have a problem, the sound stop after 1 or 2 minutes. Why please?
Can you play the URL outside of Gmod using a browser or VLC/MediaplayerClassic and it not stop?
My guess is not that this is so much this addon's fault as it is Gmod, or your provider hosting the file losing connection.
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Bite That Apple on October 30, 2016, 11:25:02 PM
To my understanding of how outside sourced audio works in gmod, is it loads it to the server first, then plays it for the client. I could be wrong, as I haven't looked too much into it, but I think I remember something like that happening to me every so often on certain songs. I can't remember though, so oh well.
Title: Re: URL Playsound Addon :) [2.28v]
Post by: Kejia on November 18, 2016, 10:04:17 AM
Looks noice, keep up the good work ;)
Title: Re: URL Playsound Addon :) [2.28v]
Post by: thedark7893214 on June 12, 2017, 10:38:25 AM
noce addon for ty is good nice utilliti
Title: Re: URL Playsound Addon :) [2.28v]
Post by: thedark7893214 on June 12, 2017, 10:39:44 AM
ptn sale fake sa marche pas comme addon sa me le télécharge pas alors que j'écris des com je report l'addon
Title: Re: URL Playsound Addon :) [2.28v]
Post by: thedark7893214 on June 12, 2017, 11:27:43 AM
addon gmod scp ptn ses nul grv sa marche pas je ne voit pas le lien
Title: Re: URL Playsound Addon :) [2.28v]
Post by: JamminR on June 12, 2017, 01:36:50 PM
Thedark, I'm using Google translate from French to English, and not even IT has any idea what you are saying.
The link is there to download. I see it when logged in.
Title: Re: URL Playsound Addon :) [2.28v]
Post by: [CTG] Thomas Macronic on June 12, 2020, 02:37:16 PM
Bonjour à vous ! J'aimerai savoir comment faire pour convertir un fichier mp3 en url. Car je n'arrive pas à utiliser l'addon.
Title: Re: URL Playsound Addon :) [2.28v]
Post by: JamminR on June 12, 2020, 06:26:53 PM

Téléchargez votre mp3 sur un serveur Web http. Ensuite, http; // votre.serveur.com/votre.mp3