Outdated version has been removed.
Latest version located here: [url]http://www.facepunch.com/threads/1074270-WolfDJ-3.0-Stream-music-to-players.-Includes-web-code?highlight=[/url]
Some issues:
When pressing f4 nothing happens and neither can I see the playing music bar.
Also when tried to open the dj menu through console "DjMenu" got this error:
addons\wolfdj\lua\autorun\client\cl_menu.lua:147: attempt to perform arithmetic on field 'ToSec' (a nil value)addons\wolfdj\lua\autorun\client\cl_menu.lua:147: attempt to perform arithmetic on field 'ToSec' (a nil value)addons\wolfdj\lua\autorun\client\cl_menu.lua:147: attempt to perform arithmetic on field 'ToSec' (a nil value)
This happened when I tried to stop the song which was somehow automatically playing when I didn't even add it to the list.
I beleave this is an issue with the version 2.1 because when I used your first release of Wold DJ:
[url]http://www.garrysmod.org/downloads/?a=view&id=102760[/url] with latest web code everything worked fine.
Hope you can fix this sometime soon.
Also everytime I try to upload song through admin.php I get:
Song failed to upload... maybe it's too big?
What is the max file size because I tried to upload a 3mb size song and it still says that.
Admin code doesn't work,
I entered this
[code]-- Player permissions
-- Defaults to IsAdmin
-- Add your custom conditions here
DJs = {
"STEAM_0:0:13239726",
"STEAM_0:1:16755445",
"steamid3"
}
local meta = FindMetaTable( "Player" )
function meta:HasDJRights()
if (self:IsAdmin() then return true end
if (self:IsUserGroup('donor')) then return true end
return (table.HasValue(DJs,self:SteamID))
end[/code]
And I get this:
[code]Lua initialized (Lua 5.1)addons/wolfdj/lua/autorun/sv_DJ.lua:189: ')' expected near 'then[/code]
Do you need a new thread for every update you release?
Why do you need a thread for 0.1 increase in a version?
I tried it again but this time without setting admins up and it doesn't work, I press F4, and nothing happends, No errors, nothing, what's wrong?
Edit: Doesn't work in single player either, Everything is set up properly, Wolf DJ is at: [url]www.jukebox.arqon-server.com[/url]
So I press F4 and nothing happends.
[QUOTE=krabazoid;24205633]Some issues:
When pressing f4 nothing happens and neither can I see the playing music bar.
Also when tried to open the dj menu through console "DjMenu" got this error:
addons\wolfdj\lua\autorun\client\cl_menu.lua:147: attempt to perform arithmetic on field 'ToSec' (a nil value)addons\wolfdj\lua\autorun\client\cl_menu.lua:147: attempt to perform arithmetic on field 'ToSec' (a nil value)addons\wolfdj\lua\autorun\client\cl_menu.lua:147: attempt to perform arithmetic on field 'ToSec' (a nil value)
This happened when I tried to stop the song which was somehow automatically playing when I didn't even add it to the list.
I beleave this is an issue with the version 2.1 because when I used your first release of Wold DJ:
[url]http://www.garrysmod.org/downloads/?a=view&id=102760[/url] with latest web code everything worked fine.
Hope you can fix this sometime soon.
Also everytime I try to upload song through admin.php I get:
Song failed to upload... maybe it's too big?
What is the max file size because I tried to upload a 3mb size song and it still says that.[/QUOTE]
It looks like I forgot the f4 look in this version. I have it hooked in another way on my server, and didn't re-add the hook for the release. My apologies. Put the following in sv_dj.lua
[LUA]
-- Hook into the F4 key
function SendMenu(ply)
ply:SendLua("Stream.OpenMenu()")
end
hook.Add( "ShowSpare2", "OpenMusic", SendMenu )
[/LUA]
The lua error looks like you are trying to stop a song that isn't playing, to ToSec hasn't been set yet.
The max upload size is determined by your web server. As your host, of generate a phpinfo() page and look it up. You can use the FTP method if you can't change it.
[quote]Do you need a new thread for every update you release? [/quote]
[quote]Why do you need a thread for 0.1 increase in a version? [/quote]
It makes it easier to correct errors pertaining to the latest version. What do you care?
[editline]08:48AM[/editline]
[QUOTE=Michelman;24207093]Admin code doesn't work,
I entered this
[code]-- Player permissions
-- Defaults to IsAdmin
-- Add your custom conditions here
DJs = {
"STEAM_0:0:13239726",
"STEAM_0:1:16755445",
"steamid3"
}
local meta = FindMetaTable( "Player" )
function meta:HasDJRights()
if (self:IsAdmin() then return true end
if (self:IsUserGroup('donor')) then return true end
return (table.HasValue(DJs,self:SteamID))
end[/code]
And I get this:
[code]Lua initialized (Lua 5.1)addons/wolfdj/lua/autorun/sv_DJ.lua:189: ')' expected near 'then[/code][/QUOTE]
There was a ) missing after "self:IsAdmin()" see the OP for the corrected code.
Awesome, Works, Thanks mr.wolf, I <3 u xD
Edit: now I get this error when using the admin code:
[code]addons/wolfdj/lua/autorun/sv_DJ.lua:197: function arguments expected near ')'[/code]
nice also this one is better to use.
[LUA]
-- Player permissions
-- Defaults to IsAdmin
-- Add your custom conditions here
DJs = {
"steamid1",
"steamid2",
"steamid3"
}
local meta = FindMetaTable( "Player" )
function meta:HasDJRights()
return (table.HasValue(DJs,self:SteamID) or self:IsAdmin() or self:IsUserGroup('donor'))
end
[/LUA]
[QUOTE=yuriman;24210883]nice also this one is better to use.
[LUA]
-- Player permissions
-- Defaults to IsAdmin
-- Add your custom conditions here
DJs = {
"steamid1",
"steamid2",
"steamid3"
}
local meta = FindMetaTable( "Player" )
function meta:HasDJRights()
return (table.HasValue(DJs,self:SteamID) or self:IsAdmin() or self:IsUserGroup('donor'))
end
[/LUA][/QUOTE]
Also doesn't work
[code]addons/wolfdj/lua/autorun/sv_DJ.lua:195: function arguments expected near ')'[/code]
[QUOTE=Michelman;24211296]Also doesn't work
[code]addons/wolfdj/lua/autorun/sv_DJ.lua:195: function arguments expected near ')'[/code][/QUOTE]
Try...
[LUA]
-- Player permissions
-- Defaults to IsAdmin
-- Add your custom conditions here
DJs = {
"steamid1",
"steamid2",
"steamid3"
}
local meta = FindMetaTable( "Player" )
function meta:HasDJRights()
return (table.HasValue(DJs,self:SteamID()) or self:IsAdmin() or self:IsUserGroup('donor'))
end
[/LUA]
There needed to be a () after SteamID.
[QUOTE=Aaron113;24211956]Try...
[LUA]
-- Player permissions
-- Defaults to IsAdmin
-- Add your custom conditions here
DJs = {
"steamid1",
"steamid2",
"steamid3"
}
local meta = FindMetaTable( "Player" )
function meta:HasDJRights()
return (table.HasValue(DJs,self:SteamID()) or self:IsAdmin() or self:IsUserGroup('donor'))
end
[/LUA]
There needed to be a () after SteamID.[/QUOTE]
Thank you man, That worked, Awesome.
Awesome music streamer, great addon for my server, I luv it
Alright,my host has max upload size of 2MB which is pretty lame,anyway I tried uploading the file through FTP but the player wont recognise it and the song does not appear in the list.
What are the requirements so that player recognises the mp3.
Thanks for help.
[QUOTE=Michelman;24212751]Thank you man, That worked, Awesome.
Awesome music streamer, great addon for my server, I luv it[/QUOTE]
Could you possibly add the feature to double click a song to add it to the queue?
[QUOTE=krabazoid;24213544]Alright,my host has max upload size of 2MB which is pretty lame,anyway I tried uploading the file through FTP but the player wont recognise it and the song does not appear in the list.
What are the requirements so that player recognises the mp3.
Thanks for help.[/QUOTE]
After you upload it through FTP, you have to use the form to add it to the database. Since the list of songs is pulled from the wolfdj.sql database file, there needs to be an entry in the database in order for it to appear on the list.
If you go to the FTP Upload section, there should be a form with Song Name, Artist, and Filename. Fill it out and submit the form, and it will add it to the database. The filename should be what the file is named on the server, such as in the example mp3, "big_booty_bitches.mp3"
[QUOTE=Aaron113;24213785]Could you possibly add the feature to double click a song to add it to the queue?[/QUOTE]
That's a good idea. I'll add it to the list for the next version, if I decide to make one. Otherwise, I'll look into a snippet to do it this evening. Unless someone else gets to it first that is :P
Sorry for bugging so much but I got another error when using FTP Upload function on admin.php.I typed in the name,artist and filename and pressed insert and got this error:
Warning: SQLiteDatabase::query() [sqlitedatabase.query]: unable to open database file in /home/radio/ftp.php on line 32
[QUOTE=krabazoid;24217981]Sorry for bugging so much but I got another error when using FTP Upload function on admin.php.I typed in the name,artist and filename and pressed insert and got this error:
Warning: SQLiteDatabase::query() [sqlitedatabase.query]: unable to open database file in /home/radio/ftp.php on line 32[/QUOTE]
Sounds like you deleted the wolfdj.sql file....
I have a error in songlist.php i cant see what the error is cause im on a IIS server.
Also why didnt you use mysql, its so much better.
[QUOTE=mr.wolf;24225823]Sounds like you deleted the wolfdj.sql file....[/QUOTE]
No the file is actually still there.
I am having problems with songs not playing entirely or not at all. If you would like my link to the webserver I'm using just ask.
[editline]11:12AM[/editline]
It seems to happen mostly when I play Let It Rock.
[editline]01:01PM[/editline]
I believe the problem is having ' in the file name.
[QUOTE=yuriman;24233031]I have a error in songlist.php i cant see what the error is cause im on a IIS server.
Also why didnt you use mysql, its so much better.[/QUOTE]
If you can't see what the error is, I can't help you.
I used SQLite because it is portable, and doesn't require people to set up a MySQL database. If you want to port it over to MySQL, feel free.
[editline]02:50PM[/editline]
[QUOTE=krabazoid;24233355]No the file is actually still there.[/QUOTE]
May I have the URL to your songlist?
[editline]02:50PM[/editline]
[QUOTE=Aaron113;24238584]I am having problems with songs not playing entirely or not at all. If you would like my link to the webserver I'm using just ask.
[editline]11:12AM[/editline]
It seems to happen mostly when I play Let It Rock.
[editline]01:01PM[/editline]
I believe the problem is having ' in the file name.[/QUOTE]
And may I have the URL to your songlist too?
[QUOTE=mr.wolf;24242108]If you can't see what the error is, I can't help you.
I used SQLite because it is portable, and doesn't require people to set up a MySQL database. If you want to port it over to MySQL, feel free.
[editline]02:50PM[/editline]
May I have the URL to your songlist?
[editline]02:50PM[/editline]
And may I have the URL to your songlist too?[/QUOTE]
Everything is relative to <snip> (I'll PM you if you still need it)
I did reupload some songs without having the ' and tried to remove the old ones with the delete.php but it didn't seem to work.
[editline]02:42PM[/editline]
Well I meant the songs worked after I removed the ' but the deleting didn't work.
Ok ive ported it for mysql but i get one error in index.php.
[CODE][B]Notice[/B]: Undefined variable: n in [B]C:\inetpub\DynamicEffect\servers\music\index.php[/B] on line [B]59[/B][/CODE]Have you updated the lua code cause stuuf like this is still there.
[CODE]string.gsub(Stream.SongTime,":","-")[/CODE]and everytime i try to open the menu i get spammed with this.
[CODE]
Timer Error: lua\includes\extensions\string.lua:169: bad argument #1 to 'gsub' (string expected, got nil)
[/CODE]
and the songlist script prints this.
[CODE]
The Sounds-Beatbox-243-ca28cd1fff2789124760e58705040208 The Sounds-Crossing the rubicon-123-86bc598bfef9ac2f958020cf6c09aac7 The Sounds-Dorchester Hotel-247-f16984b5c7b4047022e586779f0e471c The Sounds-Goodnight Freddy-244-8ee683c8b7e2dd86f8471c195a297525 The Sounds-Home is where your heart is-459-83db500e8611fac11222192dd4fc8cbc The Sounds-Lost in love-305-cfb9f714d7c729c1c543ab1d4bccc30a The Sounds-Midnight Sun-270-451c5c174e4ed055e34fdb9242a26d9d The Sounds-My Lover-265-4e83049342e1fb8718040bbb24a7677a The Sounds-No one sleeps when im awake-262-b2c4848d09f1f4afcf1cb053ae48ff57 The Sounds-Songs and a fight-204-ba440afc2d7b8897b43ff97b104e65df The Sounds-The only ones-284-ef7f491db926d08c9b223e023971b26a The Sounds-Underground-227-ae790ae35630911387dea80299c0b211 Unknown-Big Booty Bitches-224-5f9057a9ef4782aed051aaa04840704b
[/CODE]
please fix this!
I do not get a single one of those errors.
[editline]11:20AM[/editline]
Try reinstalling it completely.
If you dont get a single one of those errors you dont have the latest version.
In songlist.php
[CODE]
echo "$artist-$title-$playtime-$file\n";
[/CODE]
And on the addon it reads it like this.
[CODE]
Artist-Title-Min-Seconds-Hash [/CODE]
So it wont help to reinstall it when i already see whats wrong in the code and dont really have the time to rewrite the code.
[editline]07:49PM[/editline]
Just fixed wolfDJ with all the stuff made wrong. Like having a function withing a SQL query.
[QUOTE=yuriman;24268412]If you dont get a single one of those errors you dont have the latest version.
In songlist.php
[CODE]
echo "$artist-$title-$playtime-$file\n";
[/CODE]
And on the addon it reads it like this.
[CODE]
Artist-Title-Min-Seconds-Hash [/CODE]
So it wont help to reinstall it when i already see whats wrong in the code and dont really have the time to rewrite the code.
[editline]07:49PM[/editline]
Just fixed wolfDJ with all the stuff made wrong. Like having a function withing a SQL query.[/QUOTE]
Anyway you could share those fixes with us?
[QUOTE=yuriman;24268412]If you dont get a single one of those errors you dont have the latest version.
In songlist.php
[CODE]
echo "$artist-$title-$playtime-$file\n";
[/CODE]
And on the addon it reads it like this.
[CODE]
Artist-Title-Min-Seconds-Hash [/CODE]
So it wont help to reinstall it when i already see whats wrong in the code and dont really have the time to rewrite the code.
[editline]07:49PM[/editline]
Just fixed wolfDJ with all the stuff made wrong. Like having a function withing a SQL query.[/QUOTE]
Well aren't you rude and with a "better than you" mentality....
If you bothered to read the original code, you'd see certain things I didn't mention because it doesn't apply to normal users. I assumed that if you knew enough to write your own, you'd know enough to read code.
For example, it is indeed looking for [CODE]
Artist-Title-Min-Seconds-Hash [/CODE]
If you read the code, you'd see that $filetime is in the form of min-sec, and $file is the hash of the file. Therefore, it is valid, and it works. So if they are using the latest version, and haven't tried to modify it without knowing what they are doing, it works fine. They might get the Notice on the homepage because they have E_ALL turned on, and they see notices. I forgot to initilize $n to 0. I apologize.
As previously stated, I am using SQLite because it is easier to package and distribute than a full SQL database, and it makes it easier on people who just want to download and go. Also, as previously stated, I have no problem with anyone porting it to MySQL if they want to, but ALSO as previously stated, I'm going to assume you know what you're doing.
As for the function inside an SQL statement, that is the standard way to compare an MD5 of a field using SQLite, since SQLite doesn't have a built in MD% function like MySQL has. (See the previous paragraph for an explanation of why I used SQLite instead of MySQL).
In short, if you used the code as is, it should work (excepting the two sections of code in the FAQ in the OP if you want to use F4 and custom admin). If you wanted to modify it and botch the job, then it's probably going to break.
Ok im sorry if i was rude. This is a nice addon. But in the addon and website files its a different format when retrieving in songlist.php. Thats what i said.
Which is incorrect. They are in a different format if you mess with the code. The variable $filetime is in the form of "$min-$sec"; If you output the original script, you will see this is true. If you mess with it, it probably won't work.
Can you play music directly off of your broswer?
Sorry, you need to Log In to post a reply to this thread.