Raised This Month: $51 Target: $400
 12% 

Timed delay between each line in function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 12-03-2014 , 05:35   Timed delay between each line in function
Reply With Quote #1

I'm trying to figure out a way to speak a custom sentence with a timed delay after each played sound, but I'm stuck to get further on it.
The function is meant to be executed once at a time, therefore I need this delay.
Code:
float g_delayTime; int PlayRndSz( edict_t *pEntity, const char *szSentence, float volume, int pitch ) {     if ( szSentence == "SENT_TEST1" )     {         // 1         EMIT_SOUND_DYN( pEntity, CHAN_VOICE, "vox/buzzwarn", volume, ATTN_NORM, 0, pitch );         g_delayTime = gpGlobals->time + 0.5;         // --- play next sound ---         // 2         EMIT_SOUND_DYN( pEntity, CHAN_VOICE, "vox/hello", volume, ATTN_NORM, 0, pitch );         g_delayTime = gpGlobals->time + 1;         // --- play next sound ---         // 3         EMIT_SOUND_DYN( pEntity, CHAN_VOICE, "vox/press", volume, ATTN_NORM, 0, pitch );         g_delayTime = 0;         return TRUE;     }     else if ( szSentence == "SENT_TEST2" )     {         //...         {             //...             EMIT_SOUND_DYN( pEntity, CHAN_VOICE, szSentence, volume, ATTN_NORM, 0, pitch );         }         g_delayTime = 0;         return TRUE;     }     return FALSE; }

Last edited by Rirre; 12-03-2014 at 06:30.
Rirre is offline
Reply



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 03:20.


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