Add a sound
Hi i have this plugin and i wont to add a sound for this ..
ho can add this?
ho can add this?
PHP Code:
#include < amxmodx >
new cCountDown = 5
new cStartTimer
public plugin_init( )
{
register_plugin( "CountDown Menu", "0.1", "MyPc" )
register_clcmd( "say /cd", "countdown_menu" )
}
public countdown_menu( id )
{
if( !( get_user_team( id ) == 2 && is_user_alive( id ) ) )
{
return PLUGIN_HANDLED
}
new menu = menu_create( "\r[JailBreak]\y CountDown Menu", "countdown_menu_handler" );
new mItem[ 128 ]
formatex( mItem, 127, "CountDown Time: %d", cCountDown )
menu_additem( menu, mItem, "1", 0 )
menu_additem( menu, "Start& nbsp;Countdown", "2", 0 )
menu_setprop( menu, MPROP_EXIT, MEXIT_NORMAL );
menu_display( id, menu, 0 );
return PLUGIN_HANDLED
}
public countdown_menu_handler( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
ne w data[ 64 ], names[ 64 ];
new access, callback;
menu_item_getinfo( menu, item, access, data, 63, names, 63, callback );
new key = str_to_num( data );
switch( key )
{
case 1:
{
if( cCountDown == 15 )< br />{
cCountDown = 5
}
else
{
cCountDown += 5
}
return PLUGIN_HANDLED
}
case 2:
{
cStartTimer = cCountDown
fn_countdown( )
menu_destroy( menu )
}
}
return PLUGIN_HANDLED;
}
public fn_countdown( )
{
if( cStartTimer == 0 )
{
set_hudmessage( 0, 255, 0, -1.0, -1.0, 1 )
show_hudmessage( 0, "CountDown Finished !" )
return PLUGIN_HANDLED
}
else
{
set_hudmessage( 0, 255, 0, -1.0, -1.0, 0, 6.0, 1.0 )
show_hudmessage( 0, "CountDown: %d", cStartTimer )
}
cStartTimer--
set_task( 1.0, "fn_countdown" )
return PLUGIN_HANDLED
}
Orignal From: Add a sound
Post a Comment