Raised This Month: $ Target: $400
 0% 

Looping a sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-14-2010 , 05:43   Looping a sound
Reply With Quote #1

I want to loop a sound with - client_cmd(id,"spk sound.wav") - if it's possible.
Otherwise how else can I do it?

Thanks.
hornet is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-14-2010 , 06:34   Re: Looping a sound
Reply With Quote #2

set_task maybe?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-14-2010 , 19:09   Re: Looping a sound
Reply With Quote #3

Code:
PlayLoopingSound( iPlayer, const szSound[ ], Float:flSoundTime, Float:flIntervalBetweenPlays = 0.0, iTimesToLoop = 0 ) {     new iTaskID = iPlayer + 263756; // random task id     new iSoundLen = strlen( szSound );         remove_task( iTaskID );         set_task( ( flSoundTime + flIntervalBetweenPlays ), equal( szSound[ iSoundLen - 4 ], ".mp3" ? "TaskPlayMP3" : "TaskPlayWAV", iTaskID, szSound, iSoundLen + 1, iTimesToLoop > 0 ? "a" : "b", iTimesToLoop ); } public TaskPlayMP3( szSound[ ], iTaskID ) {     new iPlayer = iTaskID = 263756;         client_cmd( iPlayer, "mp3 play %s", szSound ); } public TaskPlayMP3( szSound[ ], iTaskID ) {     new iPlayer = iTaskID = 263756;         client_cmd( iPlayer, "spk %s", szSound ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 10:29.


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