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

[ES][TUT] Reproducir un sound/sonido Random


  
 
 
Thread Tools Display Modes
Author Message
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 05-08-2010 , 12:08   [ES][TUT] Reproducir un sound/sonido Random
#1

PHP Code:
#include <amxmodx> // Ya deben saber.

new const hit[][] = { "player/bhit_flesh-1.wav""player/bhit_flesh-2.wav",
"player/bhit_flesh-3.wav"

// Ahi pondremos todos los sonidos que queramos que se reproduscan.
// En este caso utilize los 3 sonidos HIT (Cuando un player se cae desde un lugar alto)
    
public plugin_precache() // Funcion para que el usuario que se conecte se le descarguen los sonidos
{
    new 
i; for (0sizeof hiti++) // Creamos un for para precachear cada sonido
        
precache_sound(hit[i])
}

public 
plugin_init()
{
    
register_plugin("Tutorial""By""Raddish"// Registramos blabla
    
register_clcmd("say /test""TEST"// Registramos en el say /test para llamar nuestra funcion.
}

public 
TEST(INDEX_ACA)
{
    
emit_sound(INDEX_ACACHAN_ITEMhit[random_num(0sizeof hit 1)], 1.0ATTN_NORM0PITCH_NORM)
    
/*
    ------------------------------------------------------------------------------------------------
    - 1. emit_sound: Funcion de emitir el sonido
    - 2. INDEX_ACA: El index del player
    - 3. CHAN_ITEM: nose lo que es :P
    - 4. hit[random_num(0, sizeof hit - 1): hacemos un random en la const hit desde 0 hasta
    - 4. el maximo de sonidos q abramos puesto en este caso (3)
    - 5. 1.0: seria el volumen
    - 6. ATTN_NORM, 0, PITCH_NORM: Me gustaria que me lo dijieran xq no tengo idea.
    ------------------------------------------------------------------------------------------------
    */

Para la gente que sabe me faltan algunas cositas si pudieran ayudar voy editando y lo arreglo

PD2: creo que tendria q estar en la seccion general.

Last edited by Raddish; 05-08-2010 at 13:15.
Raddish is offline
Old 05-08-2010, 12:12
Asd'
This message has been deleted by Asd'.
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 05-08-2010 , 12:16   Re: [ES][TUT] Reproducir un sound/sonido Random (no terminado)
#2

Quote:
Originally Posted by Asd' View Post
Usa emit_sound();
precache_sound( );
Ready.
Raddish is offline
Fail!
BANNED
Join Date: Jan 2010
Location: BFTCommunity
Old 05-08-2010 , 12:31   Re: [ES][TUT] Reproducir un sound/sonido Random
#3

Buen tutorial Raddish, esto lo agrego a la recopilacion ya...
Fail! is offline
Send a message via MSN to Fail!
vazmar
Veteran Member
Join Date: Apr 2009
Old 05-08-2010 , 12:50   Re: [ES][TUT] Reproducir un sound/sonido Random
#4

Quote:
Originally Posted by Fail! View Post
Buen tutorial Raddish, esto lo agrego a la recopilacion ya...
Quote:
Originally Posted by Raddish
PHP Code:
#include <amxmodx> // Ya deben saber. 
PHP Code:
3. CHAN_ITEMnose lo que es :
PHP Code:
6. ATTN_NORM0PITCH_NORMMe gustaria que me lo dijieran xq no tengo idea
vazmar is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 05-08-2010 , 12:58   Re: [ES][TUT] Reproducir un sound/sonido Random
#5

Empesamos con el puterio ??
Raddish is offline
Fail!
BANNED
Join Date: Jan 2010
Location: BFTCommunity
Old 05-08-2010 , 12:58   Re: [ES][TUT] Reproducir un sound/sonido Random
#6

JaJa no agas caso Raddish
Fail! is offline
Send a message via MSN to Fail!
Kiske
Veteran Member
Join Date: May 2009
Old 05-08-2010 , 13:13   Re: [ES][TUT] Reproducir un sound/sonido Random
#7

Lol, el plugin_precache no se registra como evento.
__________________

Kiske is offline
Send a message via Skype™ to Kiske
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 05-08-2010 , 13:15   Re: [ES][TUT] Reproducir un sound/sonido Random
#8

funcion te gusta mas =)?
Raddish is offline
vazmar
Veteran Member
Join Date: Apr 2009
Old 05-08-2010 , 13:16   Re: [ES][TUT] Reproducir un sound/sonido Random
#9

//Attenuation values
ATTN_NONE 0.00
ATTN_NORM 0.80
ATTN_IDLE 2.00
ATTN_STATIC 1.25

//Pitch values
PITCH_NORM 100
PITCH_LOW 95
PITCH_HIGH 120
vazmar is offline
Kiske
Veteran Member
Join Date: May 2009
Old 05-08-2010 , 13:22   Re: [ES][TUT] Reproducir un sound/sonido Random
#10

Quote:
Originally Posted by Raddish View Post
funcion te gusta mas =)?
Si al menos para hacer el Tutorial te gastas buscando las Funciones en los Includes, se va a notar que le pusiste esfuerzo, pero se ve que no.

Quote:
/* Use here model_precache() and sound_precache() functions. */
forward plugin_precache();
Quote:
/* Constants for emit_sound() */
/* Channels */
#define CHAN_AUTO 0
#define CHAN_WEAPON 1
#define CHAN_VOICE 2
#define CHAN_ITEM 3
#define CHAN_BODY 4
#define CHAN_STREAM 5 /* allocate stream channel from the static or dynamic area */
#define CHAN_STATIC 6 /* allocate channel from the static area */
#define CHAN_NETWORKVOICE_BASE 7 /* voice data coming across the network */
#define CHAN_NETWORKVOICE_END 500 /* network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). */

/* Attenuation values */
#define ATTN_NONE 0.00
#define ATTN_NORM 0.80
#define ATTN_IDLE 2.00
#define ATTN_STATIC 1.25

/* Pitch values */
#define PITCH_NORM 100 /* non-pitch shifted */
#define PITCH_LOW 95 /* other values are possible - 0-255, where 255 is very high */
#define PITCH_HIGH 120

/* Volume values */
#define VOL_NORM 1.0
__________________

Kiske is offline
Send a message via Skype™ to Kiske
Old 05-08-2010, 13:24
Kiske
This message has been deleted by Kiske.
 



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 18:07.


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