View Single Post
  #2  
Old 07-26-2009, 12:38 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
Well you need to use a Boolean flag to prevent the execution of job related script. Here's an example where I use a boolean flag and a loop to unset the flag when the key isn't pressed.

PHP Code:
//#CLIENTSIDE
function onKeyPressed() {
  if (
keydown(4) && !this.keydown) {
    
this.keydown true;
    
doJobStuff();
    
setTimer(0.05);
  }
}

function 
onTimeout() {
  
this.keydown keydown(4);
  if (
this.keydownsetTimer(0.05);
}

function 
doJobStuff() {
  
player.chat "shoveling dawg";

__________________
Quote:
Reply With Quote