Thread: A special door
View Single Post
  #1  
Old 08-24-2006, 01:09 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
A special door

Okay, so I'm making doors that can be opened by a key or lockpicking, and they are serverside. (Although this doesn't work clientside either).
Basically, I'm having trouble with the picking part. All the picking weapon does is send a trigger to a certain spot. I know that action is being sent. What I am having trouble with is the actual door:
PHP Code:

function onActionpick()
{
  if(
this.locked==0)
  {
    if(
this.canbelocked==1)
    {
      if(
this.warn==0)
      {
        
player.chat="This door is unlocked, to lock it, use the lockpick again";
        
this.warn=1;
      }
      else if(
this.warn==1)
      {
        
this.warn=0;
        
pick();
      }
    }
    else
    {
      
player.chat="This door cannot be locked";
    }
  }
  else
  {
    
picklock();
  }
}
function 
onCreated()
{
  
setshape(1,32,32);
  
// TOGGLE LOCK 0=CANNOT BE LOCKED 1=CAN LOCK
  
this.canbelocked=1;
  
this.locked=1;
}
function 
picklock()
{
  
player.chat="Picking lock...";
  
//other stuff

Reply With Quote