Poll

Was this module useful, and helpful?

Yes :)
93 (94.9%)
No :(
5 (5.1%)

Total Members Voted: 0

  • Print

Author Topic: URL Playsound Addon :) [2.28v]  (Read 356254 times)

0 Members and 1 Guest are viewing this topic.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #45 on: August 14, 2013, 04:52:45 am »
-snip-

I finally got it to work :D

Glad to hear :)
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: URL Playsound Addon 2.0 :)
« Reply #46 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

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #47 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.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: URL Playsound Addon 2.0 :)
« Reply #48 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 :)
« Last Edit: August 17, 2013, 02:09:40 pm by morten7000 »

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #49 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?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: URL Playsound Addon 2.0 :)
« Reply #50 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.  
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: URL Playsound Addon 2.0 :)
« Reply #51 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
« Last Edit: August 17, 2013, 03:47:26 pm by morten7000 »

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #52 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.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #53 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/
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: URL Playsound Addon 2.0 :)
« Reply #54 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 :)

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #55 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
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #56 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



and your cl_init.lua should look like:

Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: URL Playsound Addon 2.0 :)
« Reply #57 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 :)

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URL Playsound Addon 2.0 :)
« Reply #58 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
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: URL Playsound Addon 2.0 :)
« Reply #59 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 :)

  • Print