Raised This Month: $32 Target: $400
 8% 

Connect music wont play


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-29-2020 , 12:39   Connect music wont play
Reply With Quote #1

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 -
Attached Files
File Type: sma Get Plugin or Get Source (loading_music2.sma - 82 views - 974 Bytes)

Last edited by HowToRuski; 08-29-2020 at 12:59.
HowToRuski is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-29-2020 , 13:07   Re: Connect music wont play
Reply With Quote #2

Does the file exist in that location?
__________________

Last edited by Bugsy; 08-29-2020 at 13:08.
Bugsy is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-29-2020 , 13:08   Re: Connect music wont play
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
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

Last edited by HowToRuski; 08-29-2020 at 13:10.
HowToRuski is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-29-2020 , 13:09   Re: Connect music wont play
Reply With Quote #4

Disregard that post... I see now that the file path is listed in the error.
__________________
Bugsy is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-29-2020 , 13:14   Re: Connect music wont play
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
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

Last edited by HowToRuski; 08-29-2020 at 13:15.
HowToRuski is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-29-2020 , 13:33   Re: Connect music wont play
Reply With Quote #6

Does the file exist in that directory for the server?

Check to see if it exists in that folder path for your game directory.
__________________
Bugsy is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-29-2020 , 13:35   Re: Connect music wont play
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
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

Last edited by HowToRuski; 08-29-2020 at 13:37.
HowToRuski is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-29-2020 , 16:34   Re: Connect music wont play
Reply With Quote #8

Check bitrate of the mp3, maybe it's from that. CS 1.6 accept only some bitrates.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-30-2020 , 00:55   Re: Connect music wont play
Reply With Quote #9

Quote:
Originally Posted by Shadows Adi View Post
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
HowToRuski is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 08-30-2020 , 05:43   Re: Connect music wont play
Reply With Quote #10

Quote:
Originally Posted by HowToRuski View Post
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)
__________________
DJEarthQuake is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:55.


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