Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSS[Request] Remode sounds from plugin


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hi, I would like to remove sounds from a plugin, but keep everything (hud and kill fade) exactly the same. It's a simple plugin that counts kills and headshots + screen fade. Here is the source code:
PHP Code:

#include < amxmodx >
#include < amxmisc >

new const src_sound [ ][ ] =
{
    
"Effects/ha.mp3",
    
"Effects/roundend/1.mp3""Effects/roundend/2.mp3",
    
"Effects/roundend/3.mp3""Effects/roundend/4.mp3",
    
"Effects/roundend/5.mp3""Effects/roundend/6.mp3",
    
"Effects/roundend/7.mp3""Effects/roundend/8.mp3",
    
"Effects/roundend/9.mp3""Effects/roundend/10.mp3",
    
"Effects/roundend/11.mp3""Effects/roundend/12.mp3",
    
"Effects/roundend/13.mp3""Effects/roundend/14.mp3",
    
"Effects/roundend/15.mp3""Effects/roundend/16.mp3",
    
"Effects/roundend/17.mp3""Effects/roundend/18.mp3",
    
"Effects/roundend/19.mp3""Effects/roundend/20.mp3",
    
"Effects/roundend/21.mp3""Effects/roundend/22.mp3"
}

enum _:ustats
{
    
killsheads
}

new 
UserData 33 ][ ustats ], objHud

public plugin_init ( )
{
    
register_plugin "Effects plug-in""1.0""OverGame" )
    
    
register_event "DeathMsg""EventKilling""a""1>0" )
    
    
register_logevent "logevent_round_start"2"1=Round_Start" )
    
register_logevent "logevent_round_end"2"1=Round_End" )
    
    
register_cvar "effects_screen""1" )
    
register_cvar "effects_screen_sound""1" )
    
register_cvar "effects_killing_count""1" )
    
register_cvar "effects_roundend_sound""1" )
    
    
objHud CreateHudSyncObj ( )
    
plugin_cfg ()
        
    if ( 
get_cvar_num "effects_killing_count" ) )
        
set_task 1.0"killing_count"___"b" )
}

public 
plugin_cfg ( )
{
    new 
szCfgDir 64 ], szFile 192 ]
    
get_configsdir szCfgDircharsmax szCfgDir ) )
    
formatex szFilecharsmax szFile ), "%s/Effects/effects.cfg"szCfgDir )
    if ( 
file_exists szFile ) )
        
server_cmd "exec %s"szFile )
}

public 
plugin_precache ( )
{
    for ( new 
isizeof src_sound ); i++ )
        
precache_sound src_sound ] )
}

public 
client_putinserver id )
{
    
UserData id ][ kills ] = 0
    UserData 
id ][ heads ] = 0
}

public 
logevent_round_start ( )
{
    for ( new 
idid <= get_maxplayers ( ); id++ )
    {
        
UserData id ][ kills ] = 0
        UserData 
id ][ heads ] = 0
    
}
}
    
public 
logevent_round_end ( )
{
    if ( 
get_cvar_num "effects_roundend_sound" ) )
    {
        new 
snd_round random_num 1sizeof src_sound ) - )
        for ( new 
idid <= get_maxplayers ( ); id++ )
            
client_cmd id"mp3 play sound/%s"src_sound snd_round ] )
    }
    
    return 
PLUGIN_CONTINUE
}

public 
EventKilling ( )
{
    new 
iKiller read_data )
    new 
iVictim read_data )
    new 
iHead read_data )
    
    if ( 
get_cvar_num "effects_killing_count" ) )
    {
        if ( 
iHead )
        {
            
UserData iKiller ][ kills ]++
            
UserData iKiller ][ heads ]++
        } else {
            
UserData iKiller ][ kills ]++
        }
    }
    
    if ( 
get_cvar_num "effects_screen_sound" ) )
        
client_cmd iVictim"mp3 play sound/%s"src_sound ] )
        
    if ( 
get_cvar_num "effects_screen" ) )
        
show_screen iVictim2550)
    if ( 
get_cvar_num "effects_screen" ) )
        
show_screen iKiller0255)
        
    return 
PLUGIN_HANDLED
}

public 
killing_count ( )
{
    for ( new 
id 0id <= get_maxplayers ( ); id++ )
    {
        if ( !
is_user_bot id ) && is_user_connected id ) && UserData id ][ kills ] > || UserData id ][ heads ] > )
        {
            new 
buffer 128 ], len
            set_hudmessage 
1001001000.060.704.01.0__, -)    
            
            
len format buffercharsmax buffer ), "Kills: %d^n"UserData id ][ kills ] )
            
len += format buffer len ], charsmax buffer ) - len"Headshots: %d"UserData id ][ heads ] )
            
ShowSyncHudMsg idobjHudbuffer )
        }
    }
    
    return 
PLUGIN_CONTINUE
}

stock show_screen ( const id, const r, const g, const )
{
    
message_begin MSG_ONEget_user_msgid "ScreenFade" ) , { 00}, id )
    
write_short 1<<10 )
    
write_short 1<<10 )
    
write_short 0x0000 )
    
write_byte )
    
write_byte )
    
write_byte )
    
write_byte 100 )
    
message_end ()


I tried to remove the cvars for sounds and everything from:

PHP Code:

new const src_sound [ ][ ] =
public 
plugin_precache ( )
public 
logevent_round_end ( ) 

But after that, Kill + Headshot counts no longer appears. Also, the screen fade is no longer appears. I want to remove the sounds because I will use the plugin on a CSDM server, and roundend sounds are useless there, people just wait to download them for no reason.

Can someone help me? Thanks!

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...