#include <amxmodx>
enum Lyrics
{
szText[ 512 ],
Float:fPause
}
new szLyrics[][ Lyrics ] =
{
{ "This is a lyric 1" , 1.0 },
{ "This is a lyric 2" , 2.0 },
{ "This is a lyric 3" , 3.0 },
{ "This is a lyric 4" , 4.0 },
{ "This is a lyric 5" , 5.0 },
{ "This is a lyric 6" , 6.0 }
}
new g_LyricIndex;
public plugin_init()
{
register_clcmd( "say start" , "StartKaraoke" );
}
public StartKaraoke( id )
{
g_LyricIndex = 0;
set_task( szLyrics[ g_LyricIndex ][ fPause ] , "PlayLyric" );
client_print( 0 , print_chat , szLyrics[ g_LyricIndex ][ szText ] );
}
public PlayLyric()
{
if ( ++g_LyricIndex < sizeof( szLyrics ) )
{
client_print( 0 , print_chat , szLyrics[ g_LyricIndex ][ szText ] );
set_task( szLyrics[ g_LyricIndex ][ fPause ] , "PlayLyric" );
}
else
{
client_print( 0 , print_chat , "The song is over" );
}
}