AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Connect music wont play (https://forums.alliedmods.net/showthread.php?t=327036)

HowToRuski 08-29-2020 12:39

Connect music wont play
 
1 Attachment(s)
Hello, i cant figure out how to make a mp3 song play when i connect a server.
When im connecting game console says
HTML Code:

Bad command: "mp3 play sound/biohazard/song1.mp3
- thats exactly what it says without a quote in the end.
Any help?

PHP Code:

public client_connect(id) { 
    new 
size file_size(configfile,1)
    new 
rsong random_num(0,size-1)
    new 
cursong[64], a
    read_file
(configfile,rsong,cursong,63,a)
    
client_cmd(id"mp3 play sound/biohazard/%s"cursong)
    return 
PLUGIN_CONTINUE 


Or anyone whos interested you can take a look in the plugin -

Bugsy 08-29-2020 13:07

Re: Connect music wont play
 
Does the file exist in that location?

HowToRuski 08-29-2020 13:08

Re: Connect music wont play
 
Quote:

Originally Posted by Bugsy (Post 2715896)
Do some debugging on your own to see what the problem is.
Code:
public client_connect(id) {     new size = file_size(configfile,1)     new rsong = random_num(0,size-1)     new cursong[64], a     read_file(configfile,rsong,cursong,63,a)     client_cmd(id, "mp3 play sound/biohazard/%s", cursong)
    log_amx( "playing [sound/biohazard/%s]" , cursong )
    return PLUGIN_CONTINUE }

Idk why but now it keeps crashing , the whole compiler crashes

Bugsy 08-29-2020 13:09

Re: Connect music wont play
 
Disregard that post... I see now that the file path is listed in the error.

HowToRuski 08-29-2020 13:14

Re: Connect music wont play
 
Quote:

Originally Posted by Bugsy (Post 2715898)
Disregard that post... I see now that the file path is listed in the error.

PHP Code:

L 08/29/2020 20:14:00: [loading_music2.amxxplaying [sound/biohazard/connectt2.mp3

this what i got but no sound is playing

Bugsy 08-29-2020 13:33

Re: Connect music wont play
 
Does the file exist in that directory for the server?

Check to see if it exists in that folder path for your game directory.

HowToRuski 08-29-2020 13:35

Re: Connect music wont play
 
Quote:

Originally Posted by Bugsy (Post 2715902)
Does the file exist in that directory for the server?

Check to see if it exists in that folder path for your game directory.

Yes both it downloads the file and exists in the folder , but not playing
When i enter command in console by myself it plays it, but when server plays it when connecting it shows this in game console -
Bad command: "mp3 play sound/biohazard/song1.mp3

so i enter this in console - mp3 play sound/biohazard/song1.mp3 (this plays it) but server doesnt with error Bad command: "mp3 play sound/biohazard/song1.mp3 (with quote at the beginning but not the end. idk why

Shadows Adi 08-29-2020 16:34

Re: Connect music wont play
 
Check bitrate of the mp3, maybe it's from that. CS 1.6 accept only some bitrates.

HowToRuski 08-30-2020 00:55

Re: Connect music wont play
 
Quote:

Originally Posted by Shadows Adi (Post 2715923)
Check bitrate of the mp3, maybe it's from that. CS 1.6 accept only some bitrates.

With bitrates its all good. Also its force exported to mono

DJEarthQuake 08-30-2020 05:43

Re: Connect music wont play
 
Quote:

Originally Posted by HowToRuski (Post 2715894)
Hello, i cant figure out how to make a mp3 song play when i connect a server.
When im connecting game console says
HTML Code:

Bad command: "mp3 play sound/biohazard/song1.mp3
- thats exactly what it says without a quote in the end.
Any help?

Code:
client_cmd(id, "mp3 play ^"sound/biohazard/%s^"", cursong)


All times are GMT -4. The time now is 18:17.

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