Raised This Month: $ Target: $400
 0% 

Random part of string... ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 08-14-2012 , 13:21   Random part of string... ?
Reply With Quote #1

Didn't know how name the topic properly.
...
Hi. I'd love to know if there is a possibility to create string with part, which will be a random number.
I wanna to play sound by random.
Sounds names are like hit1.wav, hit2.wav, hit3.wav etc...
I wanna to create string named
PHP Code:
"sound/hitsounds/hit%d.wav" 
where
PHP Code:
%random_num
How do i do such a variable string?
I wanna make one emitsound command, instead of making switch with 8 cases.
Is this possbile? I guess yes. But I don't know this language that much to create strings properly.

Last edited by Gadzislaw007; 08-14-2012 at 13:21.
Gadzislaw007 is offline
 


Thread Tools
Display Modes

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 05:43.


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