Jump to content

[Help]- private gate


Mateo_Strahm

Recommended Posts

I want to make script for gate that only I can open, but script doesn't work :'(

Here is script:

URgate = createObject ( 980, 1465.5, -1498.3000488281, 15.300000190735, 0, 0, 90 ) 
  
function open(command) 
    if not( accountName == "Mateo" ) then  
        cancelEvent() 
        outputChatBox("(UR Base) Gate lock.",thePlayer ) 
         
    else     
        moveObject ( URgate, 3000, 1465.5, -1498.3000488281, 9.6999998092651, 0, 0, 0) 
        outputChatBox("(UR Base) Gate opened. Do not forget to close it!",thePlayer )        
  
        end 
end  
addCommandHandler("uro", open) 
  
function close(command) 
  
moveObject ( URgate, 3000, 1465.5, -1016.8994140625, 15.300000190735, 0, 0, 0) 
  
outputChatBox("(UR Base) Kapija zatvorena.",thePlayer ) 
  
end 
addCommandHandler("urz", close) 

ERROR: garaza/URbaza.lua:9: attempt to call global ´cancle´ (a nil value)

Please tell me where is problem...

Link to comment

Like this doesn't work, when I hit /uro I got outbox Gate locked..??

URkapija = createObject ( 980, 1465.5, -1498.3000488281, 15.300000190735, 0, 0, 90 ) 
  
function open(command) 
    if not( getPlayerAccount(source) == "Mateo1997" ) then  
        cancelEvent() 
        outputChatBox("(UR Baza) Kapija Zakljucana.",thePlayer ) 
         
        else     
        moveObject ( URgate, 3000, 1465.5, -1498.3000488281, 9.6999998092651, 0, 0, 0) 
        outputChatBox("(UR Baza) Kapija otvorena. Ne zaboravi zatvoriti!",thePlayer )        
  
        end 
end  
addCommandHandler("uro", open) 
  
function close(command) 
  
moveObject ( URkapija, 3000, 1465.5, -1016.8994140625, 15.300000190735, 0, 0, 0) 
  
outputChatBox("(UR Baza) Kapija zatvorena.",thePlayer ) 
  
end 
addCommandHandler("urz", close) 

Link to comment
URgate = createObject ( 980, 1465.5, -1498.3000488281, 15.300000190735, 0, 0, 90 ) 
  
function open ( thePlayer, command ) 
    local accountName = getAccountName ( getPlayerAccount( thePlayer ) ) 
    if ( accountName == "Mateo1997" ) then 
        moveObject ( URgate, 3000, 1465.5, -1498.3000488281, 9.6999998092651, 0, 0, 0 ) 
        outputChatBox ( "(UR Base) Gate opened. Do not forget to close it!", thePlayer )       
    else    
        outputChatBox ( "(UR Base) Gate lock.", thePlayer ) 
    end 
end 
addCommandHandler("uro", open) 
  
function close ( thePlayer, command ) 
    moveObject ( URgate, 3000, 1465.5, -1016.8994140625, 15.300000190735, 0, 0, 0 ) 
    outputChatBox ( "(UR Base) Kapija zatvorena.", thePlayer ) 
end 
addCommandHandler("urz", close) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...