squar Posted February 3, 2013 Share Posted February 3, 2013 local pMarker = createMarker ( -1770.5, 984.9, 21.6, 10 ) local pGate = createObject ( 980, -1770.60, 985, 25.1, 0, 0, 90 ) setMarkerSize ( pMarker, 10.0 ) setElementVisibleTo ( pMarker, getRootElement (), false ) function markerManager() local team = getPlayerTeam ( thePlayer ) if getTeamName(team) == "Admin" then moveObject ( pGate, 980, -1770.60, 996, 25.1, 0, 0, 0 ) else moveObject( pGate, 980, -1770.60, 985, 25.1, 0, 0, 0 ) end end addEventHandler( 'onMarkerHit', pMarker, markerManager ) addEventHandler( 'onMarkerLeave', pMarker, markerManager ) Im using getPlayerTeam. I tried without it, and the gate opened and closed like it should. When i tried to add team lock, it doesnt work. Anyone sees the problem? Link to comment
Anderl Posted February 3, 2013 Share Posted February 3, 2013 There is no "thePlayer" variable. Link to comment
mjau Posted February 3, 2013 Share Posted February 3, 2013 local pMarker = createMarker ( -1770.5, 984.9, 21.6, 10 ) local pGate = createObject ( 980, -1770.60, 985, 25.1, 0, 0, 90 ) setMarkerSize ( pMarker, 10.0 ) setElementVisibleTo ( pMarker, getRootElement (), false ) function markerManager(thePlayer) local theTeam = getPlayerTeam ( thePlayer ) if getTeamName(theTeam) == "Admin" then moveObject ( pGate, 980, -1770.60, 996, 25.1, 0, 0, 0 ) else moveObject( pGate, 980, -1770.60, 985, 25.1, 0, 0, 0 ) end end addEventHandler( 'onMarkerHit', pMarker, markerManager ) addEventHandler( 'onMarkerLeave', pMarker, markerManager ) Link to comment
squar Posted February 3, 2013 Author Share Posted February 3, 2013 Thank you guys, for helping and that short reply time. I just had to connect onMarkerLeave a little bit different, but it worked perfectly! 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