Page 1 of 2

cerere plugin sunet sf. hartii

Posted: 04 Sep 2010, 12:45
by DiRTy
Salut, as dorii si eu un plugin cand se schimba harta... atunci cand mai sunt 00:00 secunde sa zica un sunet .

Re: cerere plugin sunet sf. hartii

Posted: 04 Sep 2010, 14:11
by compaq
.wav

Code: Select all

#include <amxmodx>

#pragma semicolon 1

new const g_version[] = "0.1";

new const g_Sound[] = "misc/sunet.wav";

public plugin_precache()
{
    register_plugin( "End map sound", g_version, "compaq" );

    precache_sound( g_Sound );
}

public plugin_end()
{
    static iPlayers[ 32 ], iNum, i;
    get_players( iPlayers, iNum );

    for( i = 0; i < iNum; i++ )
    {
        client_cmd( iPlayers[ i ], "spk %s", g_Sound );
    }
}
.mp3

Code: Select all

#include <amxmodx>

#pragma semicolon 1

new const g_version[] = "0.1";

new const g_Sound[] = "misc/sunet.mp3";

public plugin_precache()
{
    register_plugin( "End map sound", g_version, "compaq" );

    precache_sound( g_Sound );
}

public plugin_end()
{
    static iPlayers[ 32 ], iNum, i;
    get_players( iPlayers, iNum );

    for( i = 0; i < iNum; i++ )
    {
        client_cmd( iPlayers[ i ], "mp3 loop %s", g_Sound );
    }
}

Re: cerere plugin sunet sf. hartii

Posted: 04 Sep 2010, 16:26
by DiRTy
Nu merge.

Re: cerere plugin sunet sf. hartii

Posted: 04 Sep 2010, 16:54
by iLLuSsi0N
Ai bagat sunetul in misc?

Re: cerere plugin sunet sf. hartii

Posted: 04 Sep 2010, 18:24
by DiRTy
iLLuSsi0N wrote:Ai bagat sunetul in misc?
Tu ce crezi ?

Da.

Re: cerere plugin sunet sf. hartii

Posted: 05 Sep 2010, 14:37
by Ciprian
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include < amxmodx >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Ciprian"

new const g_Sound[ ] = "sunet.wav";
new const g_Commands[ 2 ][ ] = {
    "spk misc/",
    "mp3 play sound/misc/"
}

public plugin_init ( ) register_plugin ( PLUGIN, VERSION, AUTHOR );

public plugin_precache ( ) {
    new s_Sound[ 32 ];
    formatex ( s_Sound, charsmax ( s_Sound ), "misc/%s", g_Sound );
    
    precache_sound ( s_Sound );
    
    return PLUGIN_CONTINUE;
}

public plugin_end ( ) {
    new players[ 32 ], num;
    get_players ( players, num );
    
    for ( new i = 1; i <= num; i ++ ) {
        if ( equali ( g_Sound[ strlen ( g_Sound ) - 2 ], "m" ) )
            client_cmd ( players[ i ], "%s%s", g_Commands[ 1 ], g_Sound );
        else
            client_cmd ( players[ i ], "%s%s", g_Commands[ 0 ], g_Sound );
    }
}
Modifici doar ce e cu rosu. Poate fi sunet.wav sau sunet.mp3 :)

Re: cerere plugin sunet sf. hartii

Posted: 05 Sep 2010, 16:39
by DiRTy
Tot nu merge...

Re: cerere plugin sunet sf. hartii

Posted: 05 Sep 2010, 17:26
by Ciprian
Cauta linia

Code: Select all

g_Sound[ strlen ( g_Sound ) - 2
si in loc de 2 pune 3 sau 4 si incearca ambele variante. Daca merge imi zici care dintre ele. :))

Re: cerere plugin sunet sf. hartii

Posted: 05 Sep 2010, 17:50
by DiRTy
Nu merge nici asa nici asa :) ....

Re: cerere plugin sunet sf. hartii

Posted: 05 Sep 2010, 17:58
by Ciprian
| Afiseaza codul
[code=php]/* Plugin generated by AMXX-Studio */

#include < amxmodx >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Ciprian"

new const g_Sound[ ] = "sunet.wav";
new const g_Commands[ 2 ][ ] = {
    "spk misc/",
    "mp3 play sound/misc/"
}

public plugin_init ( ) register_plugin ( PLUGIN, VERSION, AUTHOR );

public plugin_precache ( ) {
    new s_Sound[ 32 ];
    formatex ( s_Sound, charsmax ( s_Sound ), "misc/%s", g_Sound );
    
    precache_sound ( s_Sound );
    
    return PLUGIN_CONTINUE;
}

public plugin_end ( ) {
    new players[ 32 ], num;
    get_players ( players, num );
    
    for ( new i = 0; i < num; i ++ ) {
        if ( equali ( g_Sound[ strlen ( g_Sound ) - 2 ], "m" ) )
            client_cmd ( players[ i ], "%s%s", g_Commands[ 1 ], g_Sound );
        else
            client_cmd ( players[ i ], "%s%s", g_Commands[ 0 ], g_Sound );
    }
} [/code]
vezi acum, daca nu merge, incearca cu 2 sau 3 sau 4 iar :)

Re: cerere plugin sunet sf. hartii

Posted: 05 Sep 2010, 18:31
by DiRTy
Tot nu merge... offff...

Re: cerere plugin sunet sf. hartii

Posted: 05 Sep 2010, 19:13
by compaq
Sunetul e .mp3 sau .wav?