Jump to content

admin marker code :D


GerardWay

Recommended Posts

can anyone edit this code so the gate only opens to admins please?

function onStartup () 
  
    myMarker = createMarker( 207.69999694824, 1875.5, 12.39999961853, 'corona', 15.0, 0, 0, 255, 0) 
        gate1 = createObject (969, 209.69999694824, 1875.5, 12.39999961853, 0, 0, 0) 
  
    addEventHandler( "onMarkerHit", myMarker, MarkerHit1 ) 
        addEventHandler( "onMarkerLeave", myMarker, MarkerLeave1 ) 
end 
  
function MarkerHit1(thePlayer, hitElement, matchingDimension ) 
  
moveObject ( gate1, 2000, 210.10000610352, 1875.5999755859, 8.8999996185303) 
  
end 
      
function MarkerLeave1( leaveElement, matchingDimension ) 
moveObject ( gate1, 2000, 209.69999694824, 1875.5, 12.39999961853) 
end 
  
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStartup) 
  

Link to comment
function onStartup() 
    myMarker = createMarker( 207.69999694824, 1875.5, 12.39999961853, 'corona', 15.0, 0, 0, 255, 0) 
    gate1 = createObject (969, 209.69999694824, 1875.5, 12.39999961853, 0, 0, 0) 
  
    addEventHandler( "onMarkerHit", myMarker, MarkerHit1 ) 
    addEventHandler( "onMarkerLeave", myMarker, MarkerLeave1 ) 
end 
addEventHandler("onResourceStart", resourceRoot, onStartup) 
  
function MarkerHit1( hitElement, matchingDimension ) 
    local account = getPlayerAccount(hitElement) 
    if (account and not isGuestAccount(account)) then 
        local accountName = getAccountName(account) 
        if (isObjectInACLGroup("user."..accountName,aclGetGroup("Admin"))) 
            moveObject ( gate1, 2000, 210.10000610352, 1875.5999755859, 8.8999996185303) 
        end 
    end 
end 
      
function MarkerLeave1( leaveElement, matchingDimension ) 
    local account = getPlayerAccount(leaveElement) 
    if (account and not isGuestAccount(account)) then 
        local accountName = getAccountName(account) 
        if (isObjectInACLGroup("user."..accountName,aclGetGroup("Admin"))) 
            moveObject ( gate1, 2000, 209.69999694824, 1875.5, 12.39999961853) 
        end 
    end 
end 

Link to comment

thanks but you missed something out in the script that i added ive made the missed out parts of the script red:

function onStartup() 
    myMarker = createMarker( 207.69999694824, 1875.5, 12.39999961853, 'corona', 15.0, 0, 0, 255, 0) 
    gate1 = createObject (969, 209.69999694824, 1875.5, 12.39999961853, 0, 0, 0) 
  
    addEventHandler( "onMarkerHit", myMarker, MarkerHit1 ) 
    addEventHandler( "onMarkerLeave", myMarker, MarkerLeave1 ) 
end 
addEventHandler("onResourceStart", resourceRoot, onStartup) 
  
function MarkerHit1( hitElement, matchingDimension ) 
    local account = getPlayerAccount(hitElement) 
    if (account and not isGuestAccount(account)) then 
        local accountName = getAccountName(account) 
        if (isObjectInACLGroup("user."..accountName,aclGetGroup("Admin"))) 
    [color=#FF0000]then [/color]   
moveObject ( gate1, 2000, 210.10000610352, 1875.5999755859, 8.8999996185303) 
        end 
    end 
end 
      
function MarkerLeave1( leaveElement, matchingDimension ) 
    local account = getPlayerAccount(leaveElement) 
    if (account and not isGuestAccount(account)) then 
        local accountName = getAccountName(account) 
        if (isObjectInACLGroup("user."..accountName,aclGetGroup("Admin"))) 
        [color=#FF0000] then  [/color]  
moveObject ( gate1, 2000, 209.69999694824, 1875.5, 12.39999961853) 
        end 
    end 
end 

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