AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [HELP] Need Plugin Music (https://forums.alliedmods.net/showthread.php?t=286563)

dr hicham 08-19-2016 19:34

[HELP] Need Plugin Music
 
Hi All :D
I'Need Plugin Music When Start Round The Music Start
And When The Music Has Finish , The Music Start Again In The Same Round
Please Help Me :( And Thanks Soo Mutch :D

pupdebox 08-19-2016 20:14

Re: [HELP] Need Plugin Music
 
As far as i understand, you want to play the music 2 times per round. Is it correct? And also, do you want to play wav or mp3. Give more details please so that people can help you fast

dr hicham 08-19-2016 20:31

Re: [HELP] Need Plugin Music
 
I Want 3 Times In The Round And I Want MP3

siriusmd99 08-20-2016 08:40

Re: [HELP] Need Plugin Music
 
PHP Code:

#include <amxmodx>

#define MUSIC_TIME 150 //Put here length of your sound track , for example if it has 1:20 minutes then put 80 (seconds)
#define REPEAT_TIMES 3 //How many times track repeats per round

new const g_sz_Music_File[] = "sound/music/my_track.mp3"//change your directory or filename which you want

public plugin_precache () 
{
    
precache_genericg_sz_Music_File );
}

public 
plugin_init () 
{
    
register_plugin "Music File Play""1.0",  "siriusmd99" );
    
register_logevent("event_Round_Start"2"1=Round_Start")  
}

public 
event_Round_Start()
{
    
remove_task()
    
set_task(float(MUSIC_TIME), "repeat_track", .flags="a", .repeat REPEAT_TIMES)
}

public 
repeat_track()
{
    
client_cmd(0"stopsound;mp3 stop"); //Stop sounds in case music time is not defined corectly or another sound started to play
    
client_cmd 0"mp3 play %s"g_sz_Music_File );



dr hicham 08-20-2016 08:42

Re: [HELP] Need Plugin Music
 
Thanks Bro I Well Try It :D

siriusmd99 08-20-2016 08:48

Re: [HELP] Need Plugin Music
 
Quote:

Originally Posted by dr hicham (Post 2446590)
Thanks Bro I Well Try It :D

Did you understand that how you need to change the defines and sound file to your own?

#define MUSIC_TIME 150

150 is the time of your music track.

If it has 2 minutes then you will have 2*60 = 120
so it would be

#define MUSIC_TIME 120

ok?

dr hicham 08-20-2016 08:56

Re: [HELP] Need Plugin Music
 
Bro The Plugin Work But
I Do Not Hear Music When The Round Start

siriusmd99 08-20-2016 10:09

Re: [HELP] Need Plugin Music
 
Fixed:

PHP Code:

#include <amxmodx>

#define MUSIC_TIME 150 //Put here length of your sound track , for example if it has 1:20 minutes then put 80 (seconds)
#define REPEAT_TIMES 3 //How many times track repeats per round

new const g_sz_Music_File[] = "sound/music/my_track.mp3"//change your directory or filename which you want

public plugin_precache () 
{
    
precache_genericg_sz_Music_File );
}

public 
plugin_init () 
{
    
register_plugin "Music File Play""1.0",  "siriusmd99" );
    
register_logevent("event_Round_Start"2"1=Round_Start");  
}

public 
event_Round_Start()
{
    
remove_task();
    
repeat_track();
    
set_task(float(MUSIC_TIME), "repeat_track", .flags="a", .repeat REPEAT_TIMES );
}

public 
repeat_track()
{
    
client_cmd(0"stopsound;mp3 stop"); //Stop sounds in case music time is not defined corectly or another sound started to play
    
client_cmd 0"mp3 play %s"g_sz_Music_File );



dr hicham 08-20-2016 13:28

Re: [HELP] Need Plugin Music
 
Not Work :(
The Same Problem

podboat05 08-21-2016 01:12

Re: [HELP] Need Plugin Music
 
Quote:

Originally Posted by dr hicham (Post 2446694)
Not Work :(
The Same Problem

the rate of mp3 may not be supported convert it to 22050hz then try again


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

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