View Single Post
  #1  
Old 12-28-2011, 03:36 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Custom Gralat Class

I liked Classic iPhones gralat locking system so much that I made my own.
Anyway here is mine.
It allows you to lock gralats if you're in a level that starts with house_account, you may want to restrict it to a level, if so leave that in.
The only difference is that even if you're the owner they WON'T pick up if they're locked, that was the only thing I hate about Classic iPhone in that regards.
PHP Code:
function onCreated() {
  
this.setshape(0,32,32);
  
dontblock();
  
showcharacter();
  
updategani();
}
function 
onUpdategani() {
  
updategani();
}

function 
updategani() {
  
temp.type 1;
  if (
rupees>=100temp.type 4;
  else if (
rupees>=30temp.type 3;
  else if (
rupees>=5temp.type 2;

  
setcharani("gralats"temp.type);
}

function 
onPlayerTouchsMe() {
  if(
this.locked == 0){
    
player.rupees += rupees;
    
rupees 0;
    
destroy();
  }else{
  
this.chat "(Locked)";
  
sleep(2);
  
this.chat "";
  }
}
function 
onActionLeftMouse(){
  if(
this.locked == 1){
  
this.chat rupees@" (Locked)";
  
sleep(2);
  
this.chat "";
  }else{
  
this.chat rupees;
  
sleep(2);
  
this.chat "";
  }
}
function 
onActionDoubleMouse(){
  
temp.lname player.level.name.substring(6);
  
temp.lname lname.substring(0lname.pos(".nw").trim());
  
//had to use it twice, I tried  player.level.name.substring(6,  lname.pos(".nw").trim());  with no luck.
  
if(player.account == lname){
    
this.locked = !this.locked;
    if(
this.locked == 1){
      
this.chat "Locked!";
      
sleep(2);
      
this.chat "";
    }
    if(
this.locked == 0){
      
this.chat "Unlocked!";
      
sleep(2);
      
this.chat "";
    }
  }

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion

Last edited by Gunderak; 12-29-2011 at 03:35 PM..
Reply With Quote