Raised This Month: $51 Target: $400
 12% 

[Ayuda] Musica


  
 
 
Thread Tools Display Modes
Author Message
wEEk
Senior Member
Join Date: Sep 2012
Old 03-03-2013 , 11:29   [Ayuda] Musica
#1

Esto es mas una duda que ayuda Xp a este code lo encontre en T! y queria preguntar como es que lo tengo que hacer

Code:
#include <amxmodx>

new const MUSICA[] = "musica.wav" 


public plugin_init()
{
	set_task(5.0, "tocar_musica") 
}

public plugin_precache() 
{
	precache_sound(MUSICA)
	
}

public tocar_musica()
{
	client_cmd(0, "spk sounds/%s", MUSICA)
	
}
Tengo que crear una carpeta Sounds y adentro algo que se llame musica.wav??
wEEk is offline
LuKks
Senior Member
Join Date: Dec 2012
Location: Argentina, Santa Fe
Old 03-03-2013 , 11:32   Re: [Ayuda] Musica
#2

en la carpeta sounds tenes que poner el sonido EJEMPLO:

cstrike/sounds/musica.wav
LuKks is offline
wEEk
Senior Member
Join Date: Sep 2012
Old 03-03-2013 , 11:36   Re: [Ayuda] Musica
#3

Quote:
Originally Posted by LuKks View Post
en la carpeta sounds tenes que poner el sonido EJEMPLO:

cstrike/sounds/musica.wav

A dale gracias, ahora lo pruebo
wEEk is offline
LuKks
Senior Member
Join Date: Dec 2012
Location: Argentina, Santa Fe
Old 03-03-2013 , 12:29   Re: [Ayuda] Musica
#4

ok, fijate y decime si andubo asi me siento orgulloso (? xD
LuKks is offline
wEEk
Senior Member
Join Date: Sep 2012
Old 03-03-2013 , 12:43   Re: [Ayuda] Musica
#5

Nope, no me funciono le cambie el nombre de
PHP Code:
new const MUSICA[] = "musica.wav" 
a
PHP Code:
new const MUSICA[] = "musica.mp3" 
Y puse musica mp3 hay algo malo hay? y tambien puse la carpeta Sounds en CStrike.

Edito; estoy usando este rr

PHP Code:
#include <amxmodx>

#define TIME_COUNT 90 
new g_Count TIME_COUNT 


#define G_TASK 1010 

public plugin_init()
{
    
set_task(1.0"CheckTime"G_TASK, .flags="b"
}

public 
CheckTime()
{
    if(!
task_exists(G_TASK))
        return 
PLUGIN_HANDLED
    
    --
g_Count 
    
    
if(!g_Count
    {
        
remove_task(G_TASK)
        
client_print(0print_chat"La variable 'g_Count' vale '0'")
        
server_cmd("sv_restart 1"
        return 
PLUGIN_HANDLED;
    }
    
    
set_hudmessage(/* bla bla bla bla */)
    
show_hudmessage(0"Falta [%d] segundos para el RR"g_Count)
    return 
PLUGIN_CONTINUE;


Last edited by wEEk; 03-03-2013 at 12:45.
wEEk is offline
LuKks
Senior Member
Join Date: Dec 2012
Location: Argentina, Santa Fe
Old 03-03-2013 , 12:54   Re: [Ayuda] Musica
#6

no creo que ande con mp3... cs acepta wav. pero ai maneras de hacerlo con mp3. busca esto:

music menu. y adaptalo o editalo.

me tengo q ir ahora sino te pasaria link

SUERTE.
LuKks is offline
DrrunoX
Junior Member
Join Date: Nov 2012
Old 03-03-2013 , 13:13   Re: [Ayuda] Musica
#7

Para MP3 tienes que utilizar "precache_generic( );" sino no te funcionara, mírate este tutorial ya que te ayudara bastante.

Last edited by DrrunoX; 03-03-2013 at 13:17.
DrrunoX is offline
Bernii
BANNED
Join Date: Feb 2013
Location: Weed Land *-*
Old 03-03-2013 , 14:24   Re: [Ayuda] Musica
#8

PHP Code:
#include <amxmodx> 

#define TIME_COUNT 90  
new g_Count TIME_COUNT  
new const sound[ ] = "sound/bla/XXX.mp3"

#define G_TASK 1010  

public plugin_init() 

    
set_task(1.0"CheckTime"G_TASK, .flags="b")  


public 
plugin_precache( )  

    
precache_genericXXX )
}

public 
CheckTime() 

    if(!
task_exists(G_TASK)) 
        return 
PLUGIN_HANDLED;  
     
    --
g_Count  
     
    
if(!g_Count)  
    { 
        
remove_task(G_TASK
        
client_print(0print_chat"La variable 'g_Count' vale '0'"
        
server_cmd("sv_restart 1")  
        return 
PLUGIN_HANDLED
    } 
     
    
set_hudmessage(/* bla bla bla bla */
    
show_hudmessage(0"Falta [%d] segundos para el RR"g_Count
    return 
PLUGIN_CONTINUE

Te dejo eso de base tienes que agregar que cuando salga la cuenta regresiva suene la musica.
Bernii is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 03-03-2013 , 14:49   Re: [Ayuda] Musica
#9

en el plugin init se registra el.plguin tiees que dar un task como de 5 segundos en la funcion del putinserver y para reproducir se usa
const MUSICA[] = "sound/tucancion.mp3"
client_cmd(id, "mp3 play %s", MUSICA)
Te lo haria pero ando en el cel

Last edited by MexPower; 03-03-2013 at 14:51.
MexPower is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 03-03-2013 , 15:00   Re: [Ayuda] Musica
#10

Quote:
Originally Posted by MexPower View Post
en el plugin init se registra el.plguin tiees que dar un task como de 5 segundos en la funcion del putinserver y para reproducir se usa
const MUSICA[] = "sound/tucancion.mp3"
client_cmd(id, "mp3 play %s", MUSICA)
Te lo haria pero ando en el cel
y el precache.
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
 



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 11:05.


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