1LoL1 Posted July 8, 2014 Share Posted July 8, 2014 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) Link to comment
MIKI785 Posted July 8, 2014 Share Posted July 8, 2014 I don't have any idea of what you're blabbering about here and the script you posted has so many errors in it... Link to comment
AboShanab Posted July 8, 2014 Share Posted July 8, 2014 delete strings 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) Link to comment
1LoL1 Posted July 8, 2014 Author Share Posted July 8, 2014 I don't have any idea of what you're blabbering about here and the script you posted has so many errors in it... I do not care how many errors there .. especially that works 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. Link to comment
Et-win Posted July 9, 2014 Share Posted July 9, 2014 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 Link to comment
1LoL1 Posted July 9, 2014 Author Share Posted July 9, 2014 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) Link to comment
Et-win Posted July 9, 2014 Share Posted July 9, 2014 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. Link to comment
1LoL1 Posted July 9, 2014 Author Share Posted July 9, 2014 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 Link to comment
Et-win Posted July 9, 2014 Share Posted July 9, 2014 Debugscript 3 error please. Use /debugscript 3 command to see them. The first thing you give us as soon something is not working. Link to comment
1LoL1 Posted July 9, 2014 Author Share Posted July 9, 2014 there had to be attributed to the end I rewrote it. But even shows error and does not open or close .. Link to comment
Et-win Posted July 9, 2014 Share Posted July 9, 2014 Debugscript 3 error please. Use /debugscript 3 command to see them. The first thing you give us as soon something is not working. Link to comment
1LoL1 Posted July 9, 2014 Author Share Posted July 9, 2014 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 .. Link to comment
Et-win Posted July 9, 2014 Share Posted July 9, 2014 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......... Link to comment
1LoL1 Posted July 9, 2014 Author Share Posted July 9, 2014 I know .. I have a long time ago ............. Link to comment
Et-win Posted July 9, 2014 Share Posted July 9, 2014 Add test outputChatBox'es into the code to know or it did pass all codes. Link to comment
Et-win Posted July 9, 2014 Share Posted July 9, 2014 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? Link to comment
1LoL1 Posted July 9, 2014 Author Share Posted July 9, 2014 OMG I'm an idiot .............................. I then wrote another password-_-I'm sorry and thank you. Link to comment
1LoL1 Posted July 9, 2014 Author Share Posted July 9, 2014 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? Link to comment
1LoL1 Posted July 10, 2014 Author Share Posted July 10, 2014 Only Admin now. But when I want to do to Groups? Link to comment
Et-win Posted July 10, 2014 Share Posted July 10, 2014 I don't understand anything you mean, srsly. Link to comment
1LoL1 Posted July 10, 2014 Author Share Posted July 10, 2014 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. Link to comment
Et-win Posted July 10, 2014 Share Posted July 10, 2014 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now