Thread: Array help
View Single Post
  #15  
Old 08-31-2011, 01:36 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
please stop using thiso throughout this script, you clearly have no idea what its intent and purpose is for. I am sure you are having all sorts of scoping issues by calling it since thiso probably refers to a null object or the player itself when you are doing that.

PHP Code:
//#CLIENTSIDE
function onCreated(){
  
this.rights = {"Drag""Boots""Blocks"};
  
this.selected 0;
}

function 
GraalControl.onKeyDown(temp.keycodetemp.keystringtemp.scancode){
  switch(
keycode){
    case 
219this.selected = (this.selected this.selected-1); break;
    case 
220this.selected = (this.selected >= this.rights.size() ? this.rights.size() -this.selected+1); break;
    default: return;
  }
  
player.chat this.rights[this.selected];

or

PHP Code:
//#CLIENTSIDE
function onCreated(){
  
this.rights = {"Drag""Boots""Blocks"};
  
this.selected 0;
}

function 
GraalControl.onKeyDown(temp.keycodetemp.keystringtemp.scancode){
  switch(
keycode){
    case 
219this.selected = (this.selected 1) % this.rights.size(); break;
    case 
220this.selected = (this.selected 1) % this.rights.size(); break;
    default: return;
  }
  
player.chat this.rights[this.selected];

Reply With Quote