06.02.2013, 17:23
How do I make this show random fish names instead of numbers, like "Trout", "Shark", etc:
pawn Код:
random(46);
random(46);
stock RandomFish() {
#define TOTAL_FISHES 3;
new fish[TOTAL_FISHES][32] = { "Trout", "Shark", "Swordfish" };
return fish[random(TOTAL_FISHES)];
}
stock RandomFish() {
new fish[3][32] = { "Trout", "Shark", "Swordfish" };
return fish[random(sizeof fish)];
}
new name[25];
switch(random(46))
{
case 0: name = "Fish";
case 1: name = "Trout";
(...)
case 45: name = "Shark";
}
randomNameFish () { new fish[][32] = { "Trout", "Shark", "Swordfish" }; return fish[random (sizeof (fish))]; }