ULX

Recent Posts

Pages: [1] 2 3 ... 10
1
General Chat & Help and Support / Re: Playsound and adding sound help.
« Last post by JamminR on Today at 02:14:08 PM »
New working files probably aren't being downloaded to client if they already exist as non working format.
Clear client download folder sound files. Make sure server resource files are all correct format.
Reconnect to server.

And to be clear, sound format is a Source game limitation, not ULx.
2
Thanks for the reply and help.

Ok I think I got the problem solved. Must have been something with resource.lua not downloading files. Files are downloading fine now.

There is another problem now. I'm using shotcut and Audacity.

I got the server to ulx playsound ashes.wav and fightback.wav but innobeat1.wav I'm getting
Code: [Select]
You played sound innobeat1.wav
*** Invalid sample rate (48000) for sound 'innobeat1.wav'.

Keep In mind that I'm testing the sounds in sound/ folder not sound/endroundmusic/ so they are working but innobeat1 even though I exported the files as sample rate 48000. Then I exported the files as sample rate 44100 and that got ashes.wav and fightback.wav to play but innobeat1 is still giving me
Code: [Select]
*** Invalid sample rate (48000) for sound 'innobeat1.wav'.Even though i exported as 44100.

Now I copied the working sounds Directly FTP to
Code: [Select]
sound/endroundmusic/timeout/ashes.wav and
Code: [Select]
sound/endroundmusic/traitor/fightback.wav and even through the files play in sound folder the same file gives me
Code: [Select]
*** Invalid sample rate (48000) for sound 'endroundmusic\traitor\fightback.wav'.

Any speculation on why the same file works in sound and has a different sample rate in sub directories?

Here is the full console
Code: [Select]
This server is running ULX Admin Mod v3.73d (05/20/18) by Team Ulysses from ulyssesmod.net
] ulx playsound ashes.wav   <------Works (I exported as sample rate 44100)
You played sound ashes.wav
] ulx playsound fightback.wav   <------Works (I exported as sample rate 44100)
You played sound fightback.wav
] ulx playsound innobeat1.wav   <------Doesn't Work (I exported as sample rate 44100)
You played sound innobeat1.wav
*** Invalid sample rate (48000) for sound 'innobeat1.wav'.
] ulx playsound endroundmusic/timeout/ashes.wav                   <------Doesn't Work (I exported as sample rate 44100)
You played sound endroundmusic/timeout/ashes.wav
*** Invalid sample rate (48000) for sound 'endroundmusic\timeout\ashes.wav'.
] ulx playsound endroundmusic/traitor/fightback.wav                                             <------Doesn't Work (I exported as sample rate 44100)
You played sound endroundmusic/traitor/fightback.wav
*** Invalid sample rate (48000) for sound 'endroundmusic\traitor\fightback.wav'.
] ulx playsound endroundmusic/innocent/innobeat1.wav                                             <------Doesn't Work (I exported as sample rate 44100)
You played sound endroundmusic/innocent/innobeat1.wav
*** Invalid sample rate (48000) for sound 'endroundmusic\innocent\innobeat1.wav'.
3
General Chat & Help and Support / Re: Playsound and adding sound help.
« Last post by JamminR on Yesterday at 07:33:11 PM »
Any help would be appreciated.

All your examples attempt to include the /sound directory.
Virtually (as an addon, /addons/blah/sounds/...anything here.wav), or literally (gmod_root/sounds/...anything here.wav"
Don't do that.
99% of all Gmod sound commands EXPECT to have the file in the /sound directory, so what you're asking scripts to do is look in /sound/sound/...folder.../file...
For your first resource.addfile example, simply try "ulx playsound /endroundmusic/traitor/tttfightback.mp3"

If that doesn't fix,
Make sure the sounds are truly downloading to your local game client. They won't play if they aren't stored locally.
Check your local Gmod folder, On windows, usually
D:\Program Files(x86)\Steam\steamapps\common\GarrysMod\garrysmod\download\sound\... your folders...\files.mp3




4
Developers Corner / Re: Command redirection
« Last post by Zealot on Yesterday at 11:20:32 AM »
Well unless TEAM_MODERATOR is a table full of teams that would classify them as staff then probably not. You'd be better off by something closer to this...
Code: Lua
  1. if ply:Team() == TEAM_MODERATOR or ply:IsSuperAdmin() then
  2.      -- blah blah blah
  3. end

You misinterpret my table check.
But regardless, I think I have a final version for the script.
Code: [Select]
hook.Add("PlayerNoClip", "PreventTheNoclip", function(ply, isallowed)
if !isallowed then
if table.HasValue({TEAM_MODERATOR}, ply:Team()) or ply:IsSuperAdmin then
                ply:ConCommand("ulx noclip")
end
end
if isallowed then return end
end)

I have not tested this at a computer yet.  I am on a work laptop.
First, there was the problem with the hook.  PlayerNoClip definitely looked like the hook I was looking for, so thank you for pointing me towards that.  Second, the way I was addressing the function would not work with the PlayerNoClip hook.  That has two identifiers:
player, and IsNoclipAllowed.  Therefore, I changed it so that if noclip is NOT allowed then we initiate the script.  However, if it is allowed, we return the script.
Again, I have not tested this out.  I will test it when I get home.
5
General Chat & Help and Support / Playsound and adding sound help.
« Last post by Hot Nachos on Yesterday at 09:04:42 AM »
This sub-forum is only for help or discussion regarding projects created by Team Ulysses. If you are requesting help, please search the forums FIRST to make sure your question has not already been answered. If you still need help, fill in the following information.

There is a video link at the bottom if you want to watch me recreate my problems first.

My ULib/ULX versions (run "ulx version" in console):
ULib v2.63d (05/12/18)
ULX v3.73d (05/20/18)

Game mode(s) I am having this problem on:
GarrysMod TTT

Lua errors shown in console, if any:
Code: [Select]
ulx playsound innobeat1.wav
You played sound innobeat1.wav
[LC ULib ERROR] Received invalid sound

So I'm trying to add end round music to my server. After following mods guide I'm trying to play sound to see if it works. I'll post my command and a snip of what shows in console and what I see in FTP.

Trying to play sound in directory.
Commands used:
ulx playsound sound/endroundmusic/traitor/tttfightback.mp3
ulx playsound /sound/endroundmusic/traitor/tttfightback.mp3
ulx playsound /garrysmod/sound/endroundmusic/traitor/tttfightback.mp3
error given:
That sound doesn't exist on the server!

I'm hosting through NFO and I have made a lua/autorun/resource.lua file with
Code: [Select]
resource.AddFile( "sound/endroundmusic/traitor/tttfightback.mp3" )
resource.AddFile( "sound/endroundmusic/innocent/innobeat1.mp3" )
resource.AddFile( "sound/endroundmusic/timeout/ashes.mp3" )
resource.AddFile( "sound/ashes.mp3" )
resource.AddFile( "sound/innobeat1.mp3" )
resource.AddFile( "sound/tttfightback.mp3" )

I also aded the mp3 directly in the sound folder for playsound testing.

After reading through topics on how to fix this https://forums.ulyssesmod.net/index.php?topic=9548.0 and https://forum.facepunch.com/gmodhelp/goaa/How-to-add-a-sound-to-the-Ulx-Playsound/1/, it still wont fix my problem. Now when trying to use command to play sound directly in sound folder I get the following.

Code: [Select]
ulx playsound tttfightback.mp3
You played sound tttfightback.mp3
[LC ULib ERROR] Received invalid sound
] ulx playsound ashes.mp3
You played sound ashes.mp3
[LC ULib ERROR] Received invalid sound

So the server is trying to play the mp3 in sound/ashes.mp3 but im getting [LC ULib ERROR] Received invalid sound.

Here is a video of my exact problem with pictures attached to post.
https://youtu.be/MneGItaK2y8

Any help would be appreciated.
6
Developers Corner / Re: Command redirection
« Last post by BlueNova on Yesterday at 08:58:53 AM »
Hello.  I am not currently at my computer, but do you all think this would work?

Code: [Select]
hook.Add("PlayerNoClip", "PreventTheNoclip", function(ply, cmd, args)
if cmd == "noclip" then
If table.HasValue({TEAM_MODERATOR} ply:Team()) or ply:IsSuperAdmin()
ply:ConCommand( "ulx noclip" )
                end
end
end)

Let me know what you think.

Well unless TEAM_MODERATOR is a table full of teams that would classify them as staff then probably not. You'd be better off by something closer to this...
Code: Lua
  1. if ply:Team() == TEAM_MODERATOR or ply:IsSuperAdmin() then
  2.      -- blah blah blah
  3. end
7
Developers Corner / Re: Command redirection
« Last post by Zealot on Yesterday at 07:33:23 AM »
Hello.  I am not currently at my computer, but do you all think this would work?

Code: [Select]
hook.Add("PlayerNoClip", "PreventTheNoclip", function(ply, cmd, args)
if cmd == "noclip" then
If table.HasValue({TEAM_MODERATOR} ply:Team()) or ply:IsSuperAdmin()
ply:ConCommand( "ulx noclip" )
                end
end
end)

Let me know what you think.
8
Developers Corner / Re: Command redirection
« Last post by JamminR on January 21, 2019, 07:44:06 PM »
Will standard server/client console command "noclip" trigger ULibcommandcalled?
noclip is a standard server function, not even part of ULib.
I imagine, it's possible, since we hook into ALL hooks with a priority system, that we might see it.
I'm not sure that's intentional though, and wouldn't expect ULibcommandcalled to be called.

(Oh, and BlueNova, nice to see you here)

EDIT - In addition to BlueNova's suggestions, you may have better luck with the GM:PlayerNoClip hook.
9
Developers Corner / Re: Command redirection
« Last post by BlueNova on January 21, 2019, 05:12:49 PM »
Without doing something other than a quick read, you have it returning before you have the player run noclip. So the hook will stop. Maybe just replace the return statement with an if/else statement?
10
Developers Corner / Command redirection
« Last post by Zealot on January 21, 2019, 05:02:30 PM »
Hello.  I am trying to fix this script so that when the player uses the command "noclip" it redirects it to "ulx noclip".  I thought I had it at first, but it doesn't work.  Can anyone tell me what I may be doing wrong?

Code: [Select]
hook.Add("ULibCommandCalled", "PreventTheNoclip", function(ply, cmd, args)
if cmd == "noclip" then
return ply:Team() == TEAM_MODERATOR or ply:IsSuperAdmin()
ply:ConCommand( "ulx noclip" )
end
end)

Any help would be appreciated.
Pages: [1] 2 3 ... 10