AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Request plugin (https://forums.alliedmods.net/showthread.php?t=262823)

Niceone 05-13-2015 10:33

Request plugin
 
hi
can someone make plugin to stop all map sounds for all players ?
like : Rain Sound , Thunder Sound , snow Sound etc..

Example : In each round the plugin write in all players console that command (stopsound)

RaZ_HU 05-13-2015 15:06

Re: Request plugin
 
My first try, how about this one?

PHP Code:

#include <amxmodx> 

#define PLUGIN_NAME     "Ambient Stop"
    #define PLUGIN_VERSION  "0.2"
    #define PLUGIN_AUTHOR   "RaZ_HU"

new ambient_weather_effect 1;
new 
ambient_stopsound 0;

public 
plugin_init() 

    
register_plugin("PLUGIN_NAME "," PLUGIN_VERSION","PLUGIN_AUTHOR")
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
    
register_cvar("ambient_stopsound""0" );
    
register_cvar("ambient_weather_effect""1" );
    
    return 
PLUGIN_CONTINUE
}

public 
EventRoundStart( )
{
    
// Execute stopsound command on every roundstart if ambient_stopsound is 1
    // Default value is 0 - so it won't touch the cvar
    
if(ambient_stopsound == 1)
        
client_cmd0"stopsound" );
    
    
// Execute cl_weather 0 command if ambient_weather_effect is 0
    // Default value is 1 - so it won't touch the cvar
    
if(ambient_weather_effect == 0)
        
client_cmd0"cl_weather 0" );
    
    return 
PLUGIN_CONTINUE



Niceone 05-13-2015 15:42

Re: Request plugin
 
Quote:

Originally Posted by RaZ_HU (Post 2296328)
My first try, how about this one?

PHP Code:

#include <amxmodx> 

#define PLUGIN_NAME     "Ambient Stop"
    #define PLUGIN_VERSION  "0.2"
    #define PLUGIN_AUTHOR   "RaZ_HU"

new ambient_weather_effect 1;
new 
ambient_stopsound 0;

public 
plugin_init() 

    
register_plugin("PLUGIN_NAME "," PLUGIN_VERSION","PLUGIN_AUTHOR")
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
    
register_cvar("ambient_stopsound""0" );
    
register_cvar("ambient_weather_effect""1" );
    
    return 
PLUGIN_CONTINUE
}

public 
EventRoundStart( )
{
    
// Execute stopsound command on every roundstart if ambient_stopsound is 1
    // Default value is 0 - so it won't touch the cvar
    
if(ambient_stopsound == 1)
        
client_cmd0"stopsound" );
    
    
// Execute cl_weather 0 command if ambient_weather_effect is 0
    // Default value is 1 - so it won't touch the cvar
    
if(ambient_weather_effect == 0)
        
client_cmd0"cl_weather 0" );
    
    return 
PLUGIN_CONTINUE



omg this exactly what I need
Nice work bro working 100%
thank you so much.


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

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