AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Start and Stop Playing Mp3 (https://forums.alliedmods.net/showthread.php?t=84185)

Mlk27 01-22-2009 05:17

Start and Stop Playing Mp3
 
is it possible to make mp3 which playing on client to stop when they disconnect? cause it seems that once you exec client cmd to play the mp3 file, it keeps playing on client even after players quit the server..

Sn!ff3r 01-22-2009 06:25

Re: Start and Stop Playing Mp3
 
You cant execute any command on player, when he's diconnected from server.

Dores 01-22-2009 08:06

Re: Start and Stop Playing Mp3
 
Quote:

Originally Posted by Sn!ff3r (Post 748017)
You cant execute any command on player, when he's diconnected from server.

You can.

Code:
public client_disconnect(id) {     engclient_cmd(id, "stop mp3"); // This is not the answer to Mlk22's question, just an example. }

Sn!ff3r 01-22-2009 08:19

Re: Start and Stop Playing Mp3
 
@up - no!

client_disconnect is called when player already left server.

Dores 01-22-2009 08:23

Re: Start and Stop Playing Mp3
 
Quote:

Originally Posted by Sn!ff3r (Post 748057)
@up - no!

client_disconnect is called when player already left server.

Are you sure? I think that it's a pre forward, not sure.
(like always, someone is going to -karma me if I'm wrong... look at my sig)

If I'm wrong, you can hook teaminfo and if the team parameter is "UNASSIGNED", then the player disconnected(-Exolent).

Mlk27 01-22-2009 08:31

Re: Start and Stop Playing Mp3
 
Sn!ff3r is probably right about that but im actually looking for workaround to make the mp3 stop playing when they leave. Maybe like playing only the first 10 secs of the mp3 file, if players still in server, then play another 10 secs parts..

Sn!ff3r 01-22-2009 09:07

Re: Start and Stop Playing Mp3
 
Quote:

Originally Posted by Dores (Post 748060)
Are you sure? I think that it's a pre forward, not sure.
(like always, someone is going to -karma me if I'm wrong... look at my sig)

If I'm wrong, you can hook teaminfo and if the team parameter is "UNASSIGNED", then the player disconnected(-Exolent).

Yes, I'm sure.

This is post forward.

hleV 01-22-2009 09:12

Re: Start and Stop Playing Mp3
 
Quote:

Originally Posted by Dores (Post 748050)
You can.


Code:
</p><p>public client_disconnect(id)</p><p>{</p><p> engclient_cmd(id, "stop mp3"); // This is not the answer to Mlk22's question, just an example.</p><p>}

It's "mp3 stop", not "stop mp3".
Code:
public client_disconnect(iCl)         client_cmd(iCl, "mp3 stop");

Dores 01-22-2009 10:18

Re: Start and Stop Playing Mp3
 
@hleV: Did you read the comment in that code?

"just an example". :)

@Sniffer: Thanks.

hleV 01-22-2009 10:43

Re: Start and Stop Playing Mp3
 
Why couldn't you switch the words so it would be a correct example?


All times are GMT -4. The time now is 01:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.