AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   CS:GO Round Sounds (https://forums.alliedmods.net/showthread.php?t=295553)

DevilBoy.eXe 03-29-2017 08:04

CS:GO Round Sounds
 
2 Attachment(s)
CS:GO Round Sounds

This plugin, play some sound when ct/t win and when round start.
I will add sound when bomb is planted and defuse when hostage is saved or not etc... :).

CrazY. 03-29-2017 15:15

Re: CS:GO Round Sounds
 
Nice! :D

Murz 03-31-2017 16:52

Re: CS:GO Round Sounds
 
could you add granade explosion custum sounds ? fb he sg

Blizzard_87 04-06-2017 06:13

Re: CS:GO Round Sounds
 
your code can do with alot of optimising, first off.. you should use emit_sound instead of client_cmd. and you should store your sounds in variables after you precache them.

either way this type of plugin has been made heaps of times.

Ayman Khaled 06-06-2017 10:46

Re: CS:GO Round Sounds
 
This could be better ( added bomb planted, defused and exploded )
PHP Code:

#include <amxmodx>

#define PLUGIN "CS:GO Round Sounds"
#define VERSION "1.0"
#define AUTHOR "Devilboy.exe"

enum RoundSounds
{
    
Start1,
    
Start2,
    
Start3,
    
Start4,
    
BombPlanted,
    
BombDefused,
    
BombExploded,
    
TerWin,
    
CtWin
}

new const 
RoundSettings[RoundSounds][] =
{
    
"misc/start1.wav",
    
"misc/start2.wav",
    
"misc/start3.wav",
    
"misc/start4.wav",
    
"misc/bomb_planted.wav",
    
"misc/bomb_defused.wav",
    
"misc/bomb_explode.wav",
    
"misc/twingo.wav",
    
"misc/ctwingo.wav"    
}

public 
plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("SendAudio""twin""a""2&%!MRAD_terwin")
    
register_event("SendAudio""ctwin""a""2&%!MRAD_ctwin")
    
register_logevent("start",2,"0=World triggered","1=Round_Start")
}

public 
plugin_precache() 
{
    
precache_sound(RoundSettings[Start1])
    
precache_sound(RoundSettings[Start2])
    
precache_sound(RoundSettings[Start3])
    
precache_sound(RoundSettings[Start4])
    
precache_sound(RoundSettings[BombPlanted])
    
precache_sound(RoundSettings[BombDefused])
    
precache_sound(RoundSettings[BombExploded])
    
precache_sound(RoundSettings[TerWin])
    
precache_sound(RoundSettings[CtWin])
}

public 
start()
{
    new 
rand random_num(0,3)

    switch(
rand)
    {
        case 
0emit_sound(0CHAN_AUTORoundSettings[Start1], 1.0ATTN_NORM0PITCH_NORM)
        case 
1emit_sound(0CHAN_AUTORoundSettings[Start2], 1.0ATTN_NORM0PITCH_NORM)
        case 
2emit_sound(0CHAN_AUTORoundSettings[Start3], 1.0ATTN_NORM0PITCH_NORM)
        case 
3emit_sound(0CHAN_AUTORoundSettings[Start4], 1.0ATTN_NORM0PITCH_NORM)
    }

}

public 
bomb_planted()
{
    
emit_sound(0CHAN_AUTORoundSettings[BombPlanted], 1.0ATTN_NORM0PITCH_NORM)
}

public 
bomb_defused()
{
    
emit_sound(0CHAN_AUTORoundSettings[BombDefused], 1.0ATTN_NORM0PITCH_NORM)
}

public 
bomb_explode()
{
    
emit_sound(0CHAN_AUTORoundSettings[BombExploded], 1.0ATTN_NORM0PITCH_NORM)
}

public 
twin()
{
      
emit_sound(0CHAN_AUTORoundSettings[TerWin], 1.0ATTN_NORM0PITCH_NORM)
}

public 
ctwin()
{
      
emit_sound(0CHAN_AUTORoundSettings[CtWin], 1.0ATTN_NORM0PITCH_NORM)



CrazY. 06-06-2017 11:11

Re: CS:GO Round Sounds
 
for (new i = 0; i < sizeof RoundSettings; i++) ?

EFFx 06-06-2017 13:29

Re: CS:GO Round Sounds
 
Less loops is better.

Blizzard_87 06-08-2017 04:04

Re: CS:GO Round Sounds
 
PHP Code:

public start(id)
{
    new 
rand random_num(0,4)

    switch(
rand)
    {
        case 
0emit_sound(0CHAN_AUTORoundSettings[Start1], 1.0ATTN_NORM0PITCH_NORM)
        case 
1emit_sound(0CHAN_AUTORoundSettings[Start2], 1.0ATTN_NORM0PITCH_NORM)
        case 
2emit_sound(0CHAN_AUTORoundSettings[Start3], 1.0ATTN_NORM0PITCH_NORM)
        case 
3emit_sound(0CHAN_AUTORoundSettings[Start4], 1.0ATTN_NORM0PITCH_NORM)
    }



you dont need (id) in the public function as its never used.

and your random_num( 0, 4 ) should be random( 0, 3 ) as 0 - 4 is essentially 1 - 5....

HamletEagle 04-08-2020 06:14

Re: CS:GO Round Sounds
 
Way too simple to be approved.

LondoN 06-18-2020 10:47

Re: CS:GO Round Sounds
 
Code:

#include < amxmodx >
#include < fakemeta >

#define PLUGIN        "CS:GO Round Sounds"
#define VERSION        "1.0"
#define AUTHOR        "london extream"

enum
{
        START_SOUND_ONE = 0,
        START_SOUND_TWO,
        START_SOUND_THREE,
        START_SOUND_FOUR,
        BOMB_PLANTED,
        BOMB_DEFUSED,
        BOMB_EXPLODED,
        CT_WIN,
        T_WIN
};

new const Sounds [ ] [ ] =
{
        "misc/start1.wav",
        "misc/start2.wav",
        "misc/start3.wav",
        "misc/start4.wav",
        "misc/bomb_planted.wav",
        "misc/bomb_defused.wav",
        "misc/bomb_exploded.wav",
        "misc/ctwingo.wav",
        "misc/twingo.wav"
};

public plugin_precache ( )
{
        for ( new i = 0; i < sizeof Sounds; i++ )
                engfunc(EngFunc_PrecacheSound, Sounds [ i ] );
}

public plugin_init ( )
{
        register_plugin ( PLUGIN, VERSION, AUTHOR );
        register_cvar ( "csgo_r_sounds", VERSION, FCVAR_SERVER|FCVAR_SPONLY );
        set_cvar_string ( "csgo_r_sounds", VERSION );

        register_event ( "SendAudio", "tero_win", "a", "2&%!MRAD_terwin" );
        register_event ( "SendAudio", "ct_win", "a", "2&%!MRAD_ctwin" );

        register_logevent ( "RoundStart", 2, "0=World triggered", "1=Round_Start" );
}

public RoundStart ( )
{
        new i = random_num ( START_SOUND_ONE, START_SOUND_FOUR );
        emit_sound ( 0, CHAN_AUTO, Sounds [ i ], 1.0, ATTN_NORM, 0, PITCH_NORM );
}

public bomb_planted ( )        emit_sound ( 0, CHAN_AUTO, Sounds [ BOMB_PLANTED ], 1.0, ATTN_NORM, 0, PITCH_NORM );
public bomb_defused ( )        emit_sound ( 0, CHAN_AUTO, Sounds [ BOMB_DEFUSED ], 1.0, ATTN_NORM, 0, PITCH_NORM );
public bomb_exploded ( ) emit_sound ( 0, CHAN_AUTO, Sounds [ BOMB_EXPLODED ], 1.0, ATTN_NORM, 0, PITCH_NORM );
public tero_win ( )        emit_sound ( 0, CHAN_AUTO, Sounds [ T_WIN ], 1.0, ATTN_NORM, 0, PITCH_NORM );
public ct_win ( )        emit_sound ( 0, CHAN_AUTO, Sounds [ CT_WIN ], 1.0, ATTN_NORM, 0, PITCH_NORM );



All times are GMT -4. The time now is 02:07.

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