Random part of string... ?
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:
PHP Code:
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. |
Re: Random part of string... ?
PHP Code:
|
Re: Random part of string... ?
You don't need to format :
PHP Code:
PHP Code:
|
Re: Random part of string... ?
Well, both ways look correct.
Thanks for helping me guys. But it still doesn't work xD PHP Code:
it although works with console (spk sound/gad/hitsound/hit1.wav) |
Re: Random part of string... ?
You need to precache all sounds in plugin_precache with plugin_precache native.
Sounds have to be mono encoded. |
Re: Random part of string... ?
I did. Don't worry. In other cases than this random string they work.
If I put just PHP Code:
|
| All times are GMT -4. The time now is 05:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.