Jump to content

Gates by Groups


Recommended Posts

checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
function onPoliceShapeHit ( thePlayer, matchingDimension ) 
    if ( getElementType ( thePlayer ) == "player" ) then 
        outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) 
    end 
end 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
function createGate () 
    gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function onLeave ( thePlayer, matchingDimension ) 
    setTimer ( movingBackPolice, 3000, 1, thePlayer ) 
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) 
  
function movingBackPolice () 
    moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
  

hey guys im new here :D

i need help: How to edt this gate to open by groups ( Group System )

Link to comment
  
checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
function onPoliceShapeHit ( thePlayer, matchingDimension ) 
    if ( getElementType ( thePlayer ) == "player" ) then 
        outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) 
    end 
end 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
function createGate () 
    gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    if(getElementData(thePlayer,"NameGroup")=="NAME OF GROUP HERE")then 
    moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) 
end 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function onLeave ( thePlayer, matchingDimension ) 
    if(getElementData(thePlayer,"NameGroup")=="NAME OF GROUP HERE")then 
    setTimer ( movingBackPolice, 3000, 1, thePlayer ) 
end 
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) 
  
function movingBackPolice () 
    moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
  

Link to comment
  
checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
groupName = "groupName" 
function onPoliceShapeHit ( thePlayer, matchingDimension ) 
    if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    if ( getElementType ( thePlayer ) == "player" ) then 
        outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) 
    end 
end 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
function createGate () 
    gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
       if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function onLeave ( thePlayer, matchingDimension ) 
         if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    setTimer ( movingBackPolice, 3000, 1, thePlayer ) 
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) 
  
function movingBackPolice () 
      if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
  

Link to comment
  
checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
 ------------------------------------------------------------------------------------ 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
  

are you kidding me its Marker not col

Link to comment
  
checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) 
groupName = "groupName" 
function onPoliceShapeHit ( thePlayer, matchingDimension ) 
    if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    if ( getElementType ( thePlayer ) == "player" ) then 
        outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) 
    end 
end 
addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) 
  
function createGate () 
    gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
       if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function onLeave ( thePlayer, matchingDimension ) 
         if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    setTimer ( movingBackPolice, 3000, 1, thePlayer ) 
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) 
  
function movingBackPolice () 
      if not getElementData(thePlayer, "NameGroup") == groupName then return end 
    moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) 
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...