GerardWay Posted December 17, 2011 Share Posted December 17, 2011 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
Castillo Posted December 17, 2011 Share Posted December 17, 2011 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
GerardWay Posted December 17, 2011 Author Share Posted December 17, 2011 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
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