local x1, y1, z1 =  1275.3000488281 , -783.79998779297 , 1091.6999511719 
local x2, y2, z2 =  1282.4000244141 , -784.5 , 1091.6999511719 , 0 , 0 , 100 
  
local TheMarker = createMarker ( 1455.8000488281, 2773.3999023438, 11.800000190735, "arrow", 1.2, 255, 255, 0, 150 ) 
local newmarker = createMarker ( 1260.6999511719, -785.40002441406, 1092.8270263672, "arrow", 1.2, 254, 120, 0, 150 ) 
local gatemarker = createMarker ( 1282.47302, -783.39587, 1089.93750 ,"corona", 1.2, 254, 120, 0, 0 ) 
local myObjects = createObject ( 980, 1283.1999511719, -783.79998779297, 1091.6999511719 ) 
setElementDimension ( gatemarker, 20 ) 
setElementInterior ( gatemarker , 5 )       
setElementDimension ( myObjects, 20 ) 
setElementInterior ( myObjects , 5 ) 
setElementDimension ( newmarker, 20 ) 
setElementInterior ( newmarker , 5 ) 
  
  
addEventHandler ( "onMarkerHit", resourceRoot, function ( player ) 
      if ( getPlayerAccount ( player ) and not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
       if not ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( player ) ), aclGetGroup( "Console" ) ) ) then 
           return 
           exports ["guimessages"] : outputServer (player, "*Your Not Console !!" , math.random(255), math.random(255), math.random(255)) 
      end   
    if ( getElementType ( player ) == "player" ) then 
     if ( isPedInVehicle ( player ) ) then return end       
      if ( source == TheMarker ) then 
        setElementDimension ( player, 20 ) 
        setElementInterior ( player, 5, 1263.53699, -785.45905 ,1091.90625 ) 
        outputChatBox ( "* Welcome To Home Console", player, 255, 0, 0, true ) 
     elseif ( source == newmarker ) then 
        setElementPosition ( player, 1456.13135 ,2773.33740 ,11.68110 ) 
        setElementInterior ( player, 0 ) 
        setElementDimension ( player, 0 ) 
        outputChatBox ( "*Console Is Out the House !!", player, 255, 0, 0, true ) 
    elseif ( source == gatemarker ) then 
        outputChatBox( "*Console Has Been Opened the Gate", root, 254, 120, 0,false) 
        moveObject ( myObjects, 300, math.random( x1, y1 ,z1 ),math.random( x2, y2, z2 ) ) 
      end 
    end 
  end 
end ) 
  
function markergo( leaveElement , matchingDimension ) 
    if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( player ) ), aclGetGroup( "Console" ) ) ) then 
        if getElementType( leaveElement ) == "player" then 
            exports ["guimessages"] : outputServer (root, "*Console Left The Marker" , math.random(255), math.random(255), math.random(255)) 
            moveObject ( myObjects, 3000, 1283.1999511719, -783.79998779297, 1091.6999511719 ) 
        end 
    end 
end 
  
addEventHandler( "onMarkerLeave", gatemarker, markergo )