The rand() function returns a number from 0 to MAX_INT (32,767 I think). By using the modulo division operator %, you can replace <out-of> with an integer e.g. use 10 to get a random number from 0-9 inclusive.
I know that I'm just wondering how to get it from the file...
I haven't been active here in ages.
If you're wondering who i am, read my reputations. I used to make plugins, skins and spam the IRC channels here back in the good old days before Windows Live.