AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Code for "wait" (https://forums.alliedmods.net/showthread.php?t=277097)

MspoR 01-02-2016 16:04

Code for "wait"
 
Hello guys, I'm planning to make Karaoke with Text. I the question is: Ideas how to make simple hud messages with any code "wait". Like Text, wait 5 seconds, next text, wait, text. Thanks for answers.

wickedd 01-02-2016 16:25

Re: Code for "wait"
 
If I understand you correctly this should help.

redivcram 01-02-2016 17:06

Re: Code for "wait"
 
And by this should help he means download the .sma and look at the code.

Bugsy 01-02-2016 20:22

Re: Code for "wait"
 
How will the source of your text be provided?

addicted2sex 01-02-2016 21:47

Re: Code for "wait"
 
As far as I understood your question you want to make a timer thats triggered every 5 seconds ?

Bugsy 01-02-2016 22:14

Re: Code for "wait"
 
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" );
    }



MspoR 01-03-2016 02:56

Re: Code for "wait"
 
Quote:

Originally Posted by Bugsy (Post 2379297)
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.

aSior 01-07-2016 15:43

Re: Code for "wait"
 
Bugsy, can you remake it for me please?
I want it to;
Show it on Hud (say @@text)
Only CT's can turn it on
In the first text on say it will show 'NAME just turned on the microphone!' Name = person who wrote on say 'start'
It'll show (on @@) texts in different colour (@@c, @@r, @@g)

I can't pay you for it :c

devilicioux 01-14-2016 08:10

Re: Code for "wait"
 
Quote:

Originally Posted by aSior (Post 2381024)

I can't pay you for it :c

When did he ask for a payment ? :3 Most of the coders here are for helping the community with their knowledge and not for money :up:

aSior 01-14-2016 11:57

Re: Code for "wait"
 
Okay, i tough he will want money for his job ^^

But still no one helped ._.


All times are GMT -4. The time now is 09:29.

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