Jump to content

command only for admin


Recommended Posts

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

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

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

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