View Single Post
  #2  
Old 06-04-2010, 01:09 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
You can't use 'var' it's one of those undocumented keywords.

Besides why not just do: clientr.fish.(@fishtype[i])++; instead the whole temp.var thing.

I'd also recommend making a function for getting a random fish type, something like this:

PHP Code:
function onCreated() {
  
temp.fish = getRandomFishType();
  echo(
"You caught a " @ temp.fish @ "!");
}

function 
getRandomFishType() {
  
temp.fishtype = {"Whiting","Trout","Bass","Shark","Cod","Cuddlefish","Hardhead"}; 
  return 
temp.fishtype[int(random(0, temp.fishtype.size()))];
} 
__________________
Quote:
Reply With Quote