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.5, player.y-.5);
break;
case "1":
showimg(2001, "@Courier New@b@<", player.x+1.5, player.y-.5);
break;
case "2":
showimg(2001, "@Courier New@b@V", player.x+1.5, player.y-.5);
break;
case "3":
showimg(2001, "@Courier New@b@>", player.x+1.5, player.y-.5);
break;
}
return temp.arrow;
}
function GetKey()
{
temp.keyPressed = NULL;
while(temp.keyPressed = NULL)
{
for (temp.key = 0; temp.key < 4; temp.key++;)
{
if (keydown(temp.key))
{
temp.keyPressed = temp.key;
}
}
}
return temp.keyPressed;
}