Raised This Month: $ Target: $400
 0% 

public turn off/on commands


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-29-2009 , 10:50   Re: public turn off/on commands
Reply With Quote #2

Code:
    #include <amxmodx>     #include <amxmisc>           #define PLUGIN "Round Start/End"     #define AUTHOR "DoviuX"     #define VERSION "1.3"           new const gStartSounds[][] =     {         "RoundStart/Start/Start1.wav",         "RoundStart/Start/Start2.wav",         "RoundStart/Start/Start3.wav"     };         new const gEndSounds[][] =     {         "RoundStart/End/End1.wav",         "RoundStart/End/End2.wav",         "RoundStart/End/End3.wav"     };         new bool:gPluginStatus = true;         public plugin_precache()     {         new i;                 for ( i = 0; i < sizeof gStartSounds; i++ )         {               precache_sound( gStartSounds[ i ] );         }                 for ( i = 0; i < sizeof gEndSounds; i++ )         {               precache_sound( gEndSounds[ i ] );         }     }     public plugin_init()     {         register_plugin( PLUGIN, VERSION, AUTHOR );                   register_logevent( "Event_RoundStart", 2, "1=Round_Start" );         register_logevent( "Event_RoundEnd", 2, "1=Round_End" );                   register_clcmd( "say /togglesound", "ClientCommand_ToggleSound", ADMIN_CFG );         register_clcmd( "say_team /togglesound", "ClientCommand_ToggleSound", ADMIN_CFG );     }         public ClientCommand_ToggleSound ( const id, const level, const cid )     {         if ( cmd_access( id, level, cid, 1 ) )         {             gPluginStatus = !gPluginStatus;             return PLUGIN_HANDLED;         }                 return PLUGIN_CONTINUE;     }         public Event_RoundStart ()     {         if ( gPluginStatus )         {             client_cmd( 0, "spk %s", gStartSounds[ random( sizeof gStartSounds ) ] );                         set_hudmessage( 225, 225, 225, -1.0, 0.29, 2, 6.0, 12.0 );             show_hudmessage( 0, "The Ultimate Battle Has Begun !" );         }     }         public Event_RoundEnd ()     {         if ( gPluginStatus )         {             client_cmd( 0, "spk %s", gEndSounds[ random( sizeof gStartSounds ) ] );                         set_hudmessage( 225, 225, 225, -1.0, 0.29, 2, 6.0, 12.0 );             show_hudmessage( 0, "The Ultimate Battle Has ended !" );         }     }
__________________
Arkshine is offline
 



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 22:37.


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