View Single Post
  #3  
Old 02-16-2010, 10:47 AM
Jman9912 Jman9912 is offline
Registered User
Join Date: Jun 2001
Location: North Carolina
Posts: 114
Jman9912 is on a distinguished road
Send a message via AIM to Jman9912
That's not a bad idea at all. I'll try to incorporate that. Right now i'm having problems with the keychecking. I know i'm doing something wrong, but can't figure out what.

PHP Code:
function fishingCast(bait
  {
    if (
this.fishing ==1
    {
      
setTimer(0.05); //Sets timer for freezing the player
      
this.arrow ShowArrows(); //Picks a random key 0-3
      
this.fishingKey GetKey(); //Check for a key being pressed
      
echo("Keypressed = " this.fishingKey);
    } 
  }
  
function 
onTimeout() 
  {
    
freezeplayer(6);
    
setTimer(5);
  }
  
  
function 
ShowArrows() 
  {
    
temp.arrow int(random(0,3)); //Random key 0-3
    
      
switch (temp.arrow
        {
        case 
"0":
        
showimg(2001"@Courier New@b@^"player.x+1.5player.y-.5);
        break;
        
        case 
"1":
        
showimg(2001"@Courier New@b@<"player.x+1.5player.y-.5);
        break;
      
        case 
"2":
        
showimg(2001"@Courier New@b@V"player.x+1.5player.y-.5);
        break;
        
        case 
"3":
        
showimg(2001"@Courier New@b@>"player.x+1.5player.y-.5);
        break;
        }
    return 
temp.arrow;
  }
  
function 
GetKey() 
{
 
temp.keyPressed NULL;
 while(
temp.keyPressed NULL
 {
    for (
temp.key 0temp.key 4temp.key++;)
    {
      if (
keydown(temp.key)) 
      {
        
temp.keyPressed temp.key;
      }
    
    }
  }
  return 
temp.keyPressed;
  
 } 
Reply With Quote