 |
|
Member
|

01-03-2016
, 02:56
Re: Code for "wait"
|
#7
|
Quote:
Originally Posted by Bugsy
Not sure exactly what you need based on the info given, but this will play the lyric and then pause for the respective number of seconds for that lyric before playing the next. Can be easily changed to work with hud messages.
PHP Code:
#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" ); } }
|
Working. Good job, thanks.
Last edited by MspoR; 01-04-2016 at 07:40.
|
|
|
|