Raised This Month: $ Target: $400
 0% 

public turn off/on commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 09-29-2009 , 10:34   public turn off/on commands
Reply With Quote #1

how can i put a cvar to this plugin for off/on with /turnon /turnoff commands. And how to add multiple sound becouse something is wrong only plays 1 sound.

PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "Round Start/End"
#define AUTHOR "DoviuX"
#define VERSION "1.3"
 
new const STARTSOUND[]=

 
"RoundStart/Start/Start1.wav",
 
"RoundStart/Start/Start2.wav",
 
"RoundStart/Start/Start3.wav"
}
new const 
ENDSOUND[]= 

 
"RoundStart/End/End1.wav",
 
"RoundStart/End/End2.wav",
 
"RoundStart/End/End3.wav"
}
/*================================================================================
 [Plugin Start]
=================================================================================*/
public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_logevent("logevent_round_start"2"1=Round_Start")
 
register_logevent("logevent_round_end"2"1=Round_End")
 
 
register_clcmd("say /turnoff","turnoff")
 
register_clcmd("say_team /turnoff","turnoff")
 
 
register_clcmd("say /turnon","turnon")
 
register_clcmd("say_team /turnon","turnon")
}
public 
plugin_precache() 
{
 
precache_sound(STARTSOUND)
 
precache_sound(ENDSOUND)
}
public 
logevent_round_start(id) {
    
set_task(10.0"1=Round_Start")
    
client_cmd(id"spk %s"STARTSOUND)
    
set_hudmessage(225225225, -1.00.2926.012.0 );
    
show_hudmessage(0"The Ultimate Battle Has Begun !"); 
}
public 
logevent_round_end(id) {
    
set_task(10.0"1=Round_End")
    
client_cmd(id"spk %s"ENDSOUND)
    
set_hudmessage(225225225, -1.00.2926.012.0 );
    
show_hudmessage(0"The Ultimate Battle Has ended !"); 


Last edited by DoviuX; 09-29-2009 at 10:35. Reason: mistake
DoviuX is offline
Send a message via Skype™ to DoviuX
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
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 09-29-2009 , 10:53   Re: public turn off/on commands
Reply With Quote #3

thanks and is it possible for this plugin to freeze everyone alive when 10 seconds left to round end ?
and then show the ultimate battle ended! and eweryone be freeze for 10 sec till round ends
DoviuX is offline
Send a message via Skype™ to DoviuX
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 09-29-2009 , 11:00   Re: public turn off/on commands
Reply With Quote #4

my bad compiled

Last edited by DoviuX; 09-29-2009 at 11:03.
DoviuX is offline
Send a message via Skype™ to DoviuX
Reply



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