Raised This Month: $ Target: $400
 0% 

Code for "wait"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MspoR
Member
Join Date: Sep 2015
Old 01-03-2016 , 02:56   Re: Code for "wait"
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
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
{
    
szText512 ],
    
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 
StartKaraokeid )
{
    
g_LyricIndex 0;
    
    
set_taskszLyricsg_LyricIndex ][ fPause ] , "PlayLyric" );
    
client_printprint_chat szLyricsg_LyricIndex ][ szText ] );
}

public 
PlayLyric() 
{
    if ( ++
g_LyricIndex sizeofszLyrics ) )
    {
        
client_printprint_chat szLyricsg_LyricIndex ][ szText ] );
        
set_taskszLyricsg_LyricIndex ][ fPause ] , "PlayLyric" );
    }
    else
    {
        
client_printprint_chat "The song is over" );
    }



Working. Good job, thanks.

Last edited by MspoR; 01-04-2016 at 07:40.
MspoR 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 09:29.


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