devildead622 Posted March 3, 2013 Share Posted March 3, 2013 how do I run this command only for admin? function openMyGate ( player ) moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end addCommandHandler("portaoout",openMyGate) Link to comment
Metall Posted March 3, 2013 Share Posted March 3, 2013 For ACL check: local accountName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..accountName , aclGetGroup("Admin")) or isObjectInACLGroup("user."..accountName , aclGetGroup("Moderator")) then Checks both Moderator and Admin ACL. For teamcheck: if(getPlayerTeam(player) == getTeamFromName("Staff")) then Link to comment
iPrestege Posted March 3, 2013 Share Posted March 3, 2013 For ACL check: local accountName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..accountName , aclGetGroup("Admin")) or isObjectInACLGroup("user."..accountName , aclGetGroup("Moderator")) then Checks both Moderator and Admin ACL. For teamcheck: if(getPlayerTeam(player) == getTeamFromName("Staff")) then if use the Player will be not defined. Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 function createTheGate () myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function teleport ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition ( player, 307, -1520, 25 ) end end addCommandHandler("base",teleport) function openMyGate ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 29.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 28.89999961853) end end addCommandHandler("close",movingMyGateBack) so will it work? I copied the wiki Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 function createTheGate () myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function teleport ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition ( player, 307, -1520, 25 ) end end addCommandHandler("base",teleport) function openMyGate ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 29.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 28.89999961853) end end addCommandHandler("close",movingMyGateBack) so will it work? I copied the wiki Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 function createTheGate () myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function teleport ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition ( player, 307, -1520, 25 ) end end addCommandHandler("base",teleport) function openMyGate ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 29.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 28.89999961853) end end addCommandHandler("close",movingMyGateBack) so will it work? I copied the wiki Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 function createTheGate () myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function teleport ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition ( player, 307, -1520, 25 ) end end addCommandHandler("base",teleport) function openMyGate ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 29.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 28.89999961853) end end addCommandHandler("close",movingMyGateBack) so will it work? I copied the wiki Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 function createTheGate () myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function teleport ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition ( player, 307, -1520, 25 ) end end addCommandHandler("base",teleport) function openMyGate ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 29.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 28.89999961853) end end addCommandHandler("close",movingMyGateBack) so will it work? I copied the wiki Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 function createTheGate () myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function teleport ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition ( player, 307, -1520, 25 ) end end addCommandHandler("base",teleport) function openMyGate ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 29.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 28.89999961853) end end addCommandHandler("close",movingMyGateBack) so will it work? I copied the wiki Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 (edited) wtf? Edited March 3, 2013 by Guest Link to comment
iPrestege Posted March 3, 2013 Share Posted March 3, 2013 Wooow!! Spam! function createTheGate () myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function teleport ( player ) local accName = getAccountName ( getPlayerAccount (player) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition ( player, 307, -1520, 25 ) end end addCommandHandler("base",teleport) function openMyGate ( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 23.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 23.5) setTimer(movingMyGateBack,5000,1,player) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 29.5) moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 28.89999961853) end end addCommandHandler("close",movingMyGateBack) Link to comment
devildead622 Posted March 3, 2013 Author Share Posted March 3, 2013 it worked! thanks! = D 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