Author Topic: Stuck  (Read 2812 times)

I'm working on a addon, and it doesnt play a sound on other clients. I got the file, but its not playing. Could I use commandToClient to fix this issue?


post the code

this is in a server.cs
Code: [Select]
function SFXDatabase(%AudioDescription, %filename, %zipname)
{
if(isFile(""@ $TCcoreSFX::Path @ "sfx_"@ %filename @ ".wav"))
{
if(alxIsPlaying($Client::PlayingMusic))
alxStop($Client::PlayingMusic);
$Client::PlayingMusic = alxCreateSource(%AudioDescription, ""@ $TCcoreSFX::Path @ "sfx_"@ %filename @ ".wav");
alxPlay($Client::PlayingMusic);
}
if(isFile("Add-Ons/TimeControl_"@ %zipname @ ".zip/sfx/sfx_"@ %filename @ ".wav"))
{
if(alxIsPlaying($Client::PlayingMusic))
alxStop($Client::PlayingMusic);
$Client::PlayingMusic = alxCreateSource(%AudioDescription, "Add-Ons/TimeControl_"@ %zipname @ ".zip/sfx/sfx_"@ %filename @ ".wav");
alxPlay($Client::PlayingMusic);
}
}

EDIT: I wasn't sure what part of the code you wanted. I posted the sound code I used. Do you need more?

I've got a site I used to give my friend the file. Would it be easier if I gave you the site?

The entirety of the code you posted looks like code that would be client-sided.

The entirety of the code you posted looks like code that would be client-sided.

The way its used, it would be server sided. I don't know the code for it to be server sided wise, I had to make due what resources I got.

The server can't issue a stop to the client for music, unfortunately.

You can trigger a sound to play from the server, but you can't stop it. If you start playing another, they'll play on top of eachother.

The server can't issue a stop to the client for music, unfortunately.

You can trigger a sound to play from the server, but you can't stop it. If you start playing another, they'll play on top of eachother.

What if it was acting like a music brick?

The way its used, it would be server sided. I don't know the code for it to be server sided wise, I had to make due what resources I got.
alx functions are client-sided.
You're assigning a global variable that takes no consideration for multiple clients.
It looks pretty much like ripped client sided stuff.

What if it was acting like a music brick?
What do you mean? Creating an audio object? That would have the same effect as a music brick. Everyone near it would hear it.

alx functions are client-sided.
You're assigning a global variable that takes no consideration for multiple clients.
It looks pretty much like ripped client sided stuff.
What do you mean? Creating an audio object? That would have the same effect as a music brick. Everyone near it would hear it.

Thats what I'm looking for. I'm trying to mount it to the sound onto the host.

You can create a 2D AudioEmitter with a very large radius. Look at my server music add-on for code.

Thats what I'm looking for. I'm trying to mount it to the sound onto the host.
Well then, that changes everything. Try looking at the vehicle stereo mod.

You can create a 2D AudioEmitter with a very large radius. Look at my server music add-on for code.

Ok, I will do that. Where is it? I tried looking on your profile for a website.

Ok, I will do that. Where is it? I tried looking on your profile for a website.
Search button yo

Search button yo

Balls, I will just look at vechile stereo.

EDIT: Ugh what am I looking for?
« Last Edit: July 04, 2014, 12:38:42 PM by Quinn Mallory »