Jump to content

Help acl gates script.


^_^ LOL ^_^

Recommended Posts

Posted

So i code a acl gates script but its not working.

code:

local gate1 = createObject( 2951,-1643.1999511719,1204.1999511719,6.3000001907349, 0, 0, 73 ) 
-- Local Functions 
  
  
function openGate1( hitElement ) 
if (getElementType(hitElement) == "BadBoys" ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,2 ) 
end 
end 
addCommandHandler("open", openGate1) 
  
function closeGate1( leftElement ) 
if (getElementType(leftElement) == "BadBoys" ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,6.3000001907349 ) 
end 
end 
addCommandHandler("close", closeGate1) 

Posted (edited)
  
getElementType 
  

WTF..

Use:

  
  
function 11 (thePlayer) 
 local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
 if isObjectInACLGroup ("user."..accName, aclGetGroup ( "NameOfACLgroup" ) ) then 
your code here 
end 
end 
  

Learn lua,guy.

Edited by Guest
Posted

Thanks, but whats problem know.

local gate1 = createObject( 2951,-1643.1999511719,1204.1999511719,6.3000001907349, 0, 0, 73 ) 
-- Local Functions 
  
  
function(openGate1) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "BadBoys" ) ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,2 ) 
end 
end 
addCommandHandler("open", openGate1) 
  
function(closeGate1) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "BadBoys" ) ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,6.3000001907349 ) 
end 
end 
addCommandHandler("close", closeGate1) 

Posted

OMG!

  
function(closeGate1) 
function(openGate1) 

Replace:

  
function openGate1(thePlayer) 
function closeGate1(thePlayer) 
  

See,guy.

  
function name (arguments) 
  

Posted (edited)

I check, i am in group.

code:

local gate1 = createObject( 2951,-1643.1999511719,1204.1999511719,6.3000001907349, 0, 0, 73 ) 
-- Local Functions 
  
  
function openGate1 (thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "BadBoys" ) ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,2 ) 
end 
end 
addCommandHandler("open", openGate1) 
  
function closeGate1 (thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "BadBoys" ) ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,6.3000001907349 ) 
end 
end 
addCommandHandler("close", closeGate1) 

Edited by Guest
Posted (edited)

use

  

.

  
  
function openGate1 (thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "BadBoys" ) ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,2 ) 
else 
outputDebugString("Error") 
end 
end 
addCommandHandler("open", openGate1) 
  
function closeGate1 (thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "BadBoys" ) ) then 
moveObject( gate1, 1500, -1643.1999511719,1204.1999511719,6.3000001907349 ) 
else 
outputDebugString("Error") 
end 
end 
addCommandHandler("close", closeGate1) 
  
  

Check debug,when you will be on marker.

Edited by Guest

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...