AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Add Music Block (https://forums.alliedmods.net/showthread.php?t=206015)

Serkan Kischa 01-17-2013 12:27

Add Music Block
 
Hey Guys, i want to add Music block to my blockmaker but i dont know exactly how please help me, i just have this:

Quote:

##musicBlock##

new Float:gfmusicNextUse[33];
new Float:gfmusicTimeOut[33];

#########

register_cvar("bm_musiccooldown", "20.0");
register_cvar("bm_musictime", "20.0");

########

ActionMusic(id, ent)
{
if (halflife_time() >= gfMuzaTimeOut[id])
{
new Float:fTime = halflife_time();
new Float:flPropertie1, Float:flPropertie2;

pev( ent, pev_fuser1, flPropertie1 );
pev( ent, pev_fuser2, flPropertie2 );

new Float:fTimeout = get_cvar_float("bm_musictime");

gfMuzaTimeOut[id] = fTime + fTimeout;
gfMuzaNextUse[id] = fTime + fTimeout + get_cvar_float("bm_musiccooldown");
{
switch(random_num(0,10))
{
case 0:
emit_sound(id, CHAN_STREAM, gsz1, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 1:
emit_sound(id, CHAN_STREAM, gsz2, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 2:
emit_sound(id, CHAN_STREAM, gsz3, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 3:
emit_sound(id, CHAN_STREAM, gsz4, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 4:
emit_sound(id, CHAN_STREAM, gsz5, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 5:
emit_sound(id, CHAN_STREAM, gsz6, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 6:
emit_sound(id, CHAN_STREAM, gsz7, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 7:
emit_sound(id, CHAN_STREAM, gsz8, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 8:
emit_sound(id, CHAN_STREAM, gsz9, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 9:
emit_sound(id, CHAN_STREAM, gsz10, 0.8, ATTN_NORM, 0, PITCH_NORM);
case 10:
emit_sound(id, CHAN_STREAM, gsz11, 0.8, ATTN_NORM, 0, PITCH_NORM);
}
}
}
}

Serkan Kischa 01-18-2013 19:24

Re: Add Music Block
 
Quote:

Originally Posted by Serkan Kischa (Post 1875084)
Hey Guys, i want to add Music block to my blockmaker but i dont know exactly how please help me, i just have this:

blabla forgot all i said, i have Music Block now worked with 1 sound, then i added 4 sounds, and the sounds only works for ppl who put the .mp3 files into the cstrike folder, they dont download it when they join they server (when it was only 1 sound they downloaded it). So its something wrong with the precache? Please help me.
Sry for my bad English!! :cry:

Tatsuo 12-30-2017 08:17

Re: Add Music Block
 
I want to add music block too, but i dont know how

Adomaz1 12-30-2017 08:39

Re: Add Music Block
 
try to convert the mp3 files to wav

Tatsuo 12-30-2017 08:45

Re: Add Music Block
 
Quote:

Originally Posted by Adomaz1 (Post 2568853)
try to convert the mp3 files to wav

And this dont work too

Adomaz1 12-30-2017 08:58

Re: Add Music Block
 
how did you precache it

Tatsuo 12-30-2017 09:40

Re: Add Music Block
 
Quote:

Originally Posted by Adomaz1 (Post 2568858)
how did you precache it

This?
precache_sound(gsz1);
precache_sound(gsz2);
precache_sound(gsz3);
precache_sound(gsz4);
precache_sound(gsz5);
precache_sound(gsz6);
precache_sound(gsz7);
precache_sound(gsz8);
precache_sound(gsz9);
precache_sound(gsz10);
precache_sound(gsz11);

Adomaz1 12-30-2017 10:09

Re: Add Music Block
 
just show the full code

//

sorry, i don't know how =/

Tatsuo 12-30-2017 10:30

Re: Add Music Block
 
Quote:

Originally Posted by Adomaz1 (Post 2568877)
just show the full code

he is very long, I give u link for sma file Immediately say this is not my plugin
link: https://yadi.sk/d/qY10Dwb33R6grW


All times are GMT -4. The time now is 13:30.

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