View Single Post
  #5  
Old 12-19-2011, 12:29 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
It stops working because it hits the 'loop limit'. Your code was essentially doing:

PHP Code:
while (true) {
  if (
keydown(1)) stuff();

You would have to use a sleep in the while loop if you want there to be a chance for your keydown condition to change.

You may be right about your logic being out of whack because you probably don't even need to use the conditions that you're specifying. Try this code out:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
disabledefmovement();
  
setTimer(0.05);
}

function 
onTimeout() {
  if (
keydown(0)) player.-= 0.1;
  if (
keydown(1)) player.-= 0.1;
  if (
keydown(2)) player.+= 0.1;
  if (
keydown(3)) player.+= 0.1;
  
setTimer(0.05);

__________________
Quote:
Reply With Quote