Jump to content

[HELP] BASE


1LoL1

Recommended Posts

Posted

As I have to be careful that you enter the Serial IP and only one can open and close BASE? who does what it can not open it you do not have to write it on the right.

function createTheGate () 
         
         myGate1 = createObject ( "ID", "x", "y", "z", "0", "0", "0" ) 
         myGate2 = createObject ( "ID", "x", "y", "z", "0", "0", "0" ) 
         
  
      end 
  
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
 function openMyGate ( )     
 moveObject ( myGate1, 4000, "x", "y", "z" ) 
 end 
 addCommandHandler("open",openMyGate) 
  
 function movingMyGateBack () 
 moveObject ( myGate1, 4000, "x", "y", "z" ) 
 end 
 addCommandHandler("close",movingMyGateBack) 
  

Posted

delete strings :lol:

function createTheGate () 
        
         myGate1 = createObject ( ID, x, y, z, 0, 0, 0 ) 
         myGate2 = createObject ( ID, x, y, z, 0, 0, 0 ) 
         
  
      end 
  
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
 function openMyGate ( )    
 moveObject ( myGate1, 4000, x, y, z ) 
 end 
 addCommandHandler("open",openMyGate) 
  
 function movingMyGateBack () 
 moveObject ( myGate1, 4000, x, y, z ) 
 end 
 addCommandHandler("close",movingMyGateBack) 

Posted
I don't have any idea of what you're blabbering about here and the script you posted has so many errors in it... :roll:

I do not care how many errors there ..:D especially that works :D and I thought that I enter the serial player and only the player can open and close BASE .. other people to write it that you do not have the right to open and close this base.

Posted

I would use ACL Groups instead of Serials/IP's of players... If groups then just check or the player is in that specific group which can open and close the gate.

aclGetGroup 

Posted
I would use ACL Groups instead of Serials/IP's of players... If groups then just check or the player is in that specific group which can open and close the gate.
aclGetGroup 

So that?

function createTheGate () 
        
         myGate1 = createObject ( ID, x, y, z, 0, 0, 0 ) 
         myGate2 = createObject ( ID, x, y, z, 0, 0, 0 ) 
        
  
      end 
  
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
 function openMyGate ( )   
      accountname = getAccountName (getPlayerAccount(v)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
 moveObject ( myGate1, 4000, x, y, z ) 
   else  
       outputChatBox ("You do not have sufficient rights !", playerSource) 
 end 
 addCommandHandler("open",openMyGate) 
  
 function movingMyGateBack () 
      accountname = getAccountName (getPlayerAccount(v)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
 moveObject ( myGate1, 4000, x, y, z ) 
       else  
           outputChatBox ("You do not have sufficient rights !", playerSource) 
 end 
 addCommandHandler("close",movingMyGateBack) 

Posted
function createTheGate () 
        
         myGate1 = createObject ( ID, x, y, z, 0, 0, 0 ) 
         myGate2 = createObject ( ID, x, y, z, 0, 0, 0 ) 
        
  
      end 
  
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
 function openMyGate (tPlayer)   
      accountname = getAccountName (getPlayerAccount(tPlayer)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
 moveObject ( myGate1, 4000, x, y, z ) 
   else 
       outputChatBox ("You do not have sufficient rights !", tPlayer) 
 end 
 addCommandHandler("open",openMyGate) 
  
 function movingMyGateBack (tPlayer) 
      accountname = getAccountName (getPlayerAccount(tPlayer)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
 moveObject ( myGate1, 4000, x, y, z ) 
       else 
           outputChatBox ("You do not have sufficient rights !", tPlayer) 
 end 
 addCommandHandler("close",movingMyGateBack) 

Note that this is a serverside script now.

EDIT: Note that your moveObject is using the same positions as createObject has. Also as far as I can see they are not defined in the script.

Posted
function createTheGate () 
        
         myGate1 = createObject ( ID, x, y, z, 0, 0, 0 ) 
         myGate2 = createObject ( ID, x, y, z, 0, 0, 0 ) 
        
  
      end 
  
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
 function openMyGate (tPlayer)   
      accountname = getAccountName (getPlayerAccount(tPlayer)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
 moveObject ( myGate1, 4000, x, y, z ) 
   else 
       outputChatBox ("You do not have sufficient rights !", tPlayer) 
 end 
 addCommandHandler("open",openMyGate) 
  
 function movingMyGateBack (tPlayer) 
      accountname = getAccountName (getPlayerAccount(tPlayer)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
 moveObject ( myGate1, 4000, x, y, z ) 
       else 
           outputChatBox ("You do not have sufficient rights !", tPlayer) 
 end 
 addCommandHandler("close",movingMyGateBack) 

Note that this is a serverside script now.

EDIT: Note that your moveObject is using the same positions as createObject has. Also as far as I can see they are not defined in the script.

Script is turned on but the gate does not show up :(

Posted

Debugscript 3 error please. Use /debugscript 3 command to see them. The first thing you give us as soon something is not working.

Posted
Debugscript 3 error please. Use /debugscript 3 command to see them. The first thing you give us as soon something is not working.
Posted
Debugscript 3 error please. Use /debugscript 3 command to see them. The first thing you give us as soon something is not working.

However, I'm writing that no error does not write ..

Posted

Did you change the variables x, y and z? Because you are now moving the gate to x, y and z while it is already on that same variable.........

Posted

Nvm that, you say you added them. You create the marker on x, y and z. How in earth can moveObject have the same x, y and z if they are not local in the function?

Posted

Ok it goes like this .. and please if I want to do it at Groupe? I think the name of any group and only th members of the Groupe can open it?

Posted

But that any group as "Skillers" so I enter there Skillers, and only players who are in this group so they can open and close the base.

Posted

Replace:

accountname = getAccountName (getPlayerAccount(tPlayer)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) 

With:

local isAllowed = false 
for placeNumber, stringData in ipairs(acceptedGroups) do 
    accountname = getAccountName (getPlayerAccount(tPlayer)) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( stringData ) ) 
        isAllowed = true 
    end 
end 
if (isAllowed == true) then 
    --Code... 
  

Add:

acceptedGroups = { 
"Group", 
"Another Group", 
"More", 
"Mooooore", 
} 

You can add more in the acceptedGroups Table.

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