Thread: Array help
View Single Post
  #15  
Old 08-31-2011, 12:29 AM
gaben gaben is offline
uhh no
gaben's Avatar
Join Date: Aug 2011
Posts: 47
gaben is an unknown quantity at this point
Quote:
Originally Posted by 0PiX0 View Post
It's unnecessary to initialize a var to be set to 0. When incrementing, checking the condition 'this.i >= 0' is unnecessary. Also, you have the keys swapped.

Astram, I would use the method Crow described. In the end it should look somewhat like this:
PHP Code:
function GraalControl.onKeyDown(temp.keycodetemp.keystringtemp.scancode) {
  switch (
keycode) {
    case 
219:  this.selectedid = (this.selectedid 1) % this.rights.size();  break;
    case 
220:  this.selectedid = (this.selectedid 1) % this.rights.size();  break;
    default:   return;
  }
  
player.chat this.rights[this.selectedid];

wat?

PHP Code:
//#CLIENTSIDE

function onCreated(){
  
this.rights = {"Stick","Unstick","Jail","Stealth"};
}


function 
onKeyPressed(codekey){ 
  if(
key == "[" && this.3){ 
         
this.i++; // increment 
         
player.chat this.rights[this.i]; 
  } 
  else if(
key == "/" && this.0){ // don't decrement 0 to -1! 
        
this.i--; 
        
player.chat this.rights[this.i]; 
  } 

__________________
Quote:
Originally Posted by iBeatz View Post
Who came up with this Cheat Engine? The more I read about, the more ingenious the whole thing sounds.
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Quote:
Originally Posted by ff7chocoboknight View Post
You sure are taking your time leaving, furry.
Quote:
Originally Posted by [email protected] View Post
are u old enough 2 even play Graal little girl???

Last edited by gaben; 08-31-2011 at 02:15 AM..
Reply With Quote