Jokeℝ1472771893 Posted July 26, 2012 Share Posted July 26, 2012 how to make gates openned by ACL group? i create one but it's oppenned by team Link to comment
TAPL Posted July 26, 2012 Share Posted July 26, 2012 https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup Link to comment
Jokeℝ1472771893 Posted July 26, 2012 Author Share Posted July 26, 2012 this is my gates now how to make it openned by acl group members? local gate = createObject(980, 1128.3000488281, -1541.0999755859, 16.10000038147, 0, 0, 180) local marker = createMarker(1128.3000488281, -1543.5999755859, 13.300000190735, "cylinder", 2, 255, 255, 255, 255) function moveGate(hitPlayer, matchingDimension) if hasObjectPermissionTo(hitPlayer, "function.kickPlayer") then moveObject(gate, 2000, 1118, -1541.0999755859, 16.10000038147) setTimer(moveBack, 2000, 1) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 2000, 1128.3000488281, -1541.0999755859, 16.10000038147) end Link to comment
Castillo Posted July 26, 2012 Share Posted July 26, 2012 local gate = createObject ( 980, 1128.3000488281, -1541.0999755859, 16.10000038147, 0, 0, 180 ) local marker = createMarker ( 1128.3000488281, -1543.5999755859, 13.300000190735, "cylinder", 2, 255, 255, 255, 255 ) function moveGate ( hitPlayer, matchingDimension ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( hitPlayer ) ), aclGetGroup ( "Admin" ) ) then moveObject ( gate, 2000, 1118, -1541.0999755859, 16.10000038147 ) setTimer ( moveBack, 2000, 1 ) end end addEventHandler ( "onMarkerHit", marker, moveGate ) function moveBack ( ) moveObject ( gate, 2000, 1128.3000488281, -1541.0999755859, 16.10000038147 ) end Link to comment
albers14 Posted July 26, 2012 Share Posted July 26, 2012 It gonna bugs if you use a vehicle to enter as the hitElement is an vehicle now, not player. This will work, added getElementType. local gate = createObject ( 980, 1128.3000488281, -1541.0999755859, 16.10000038147, 0, 0, 180 ) local marker = createMarker ( 1128.3000488281, -1543.5999755859, 13.300000190735, "cylinder", 2, 255, 255, 255, 255 ) function moveGate ( hitPlayer, matchingDimension ) if getElementType(hitPlayer) =="player" and isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( hitPlayer ) ), aclGetGroup ( "Admin" ) ) then moveObject ( gate, 2000, 1118, -1541.0999755859, 16.10000038147 ) setTimer ( moveBack, 2000, 1 ) end end addEventHandler ( "onMarkerHit", marker, moveGate ) function moveBack ( ) moveObject ( gate, 2000, 1128.3000488281, -1541.0999755859, 16.10000038147 ) end Link to comment
Jokeℝ1472771893 Posted July 27, 2012 Author Share Posted July 27, 2012 thnx it's work but how to make gates closed onMarkerLeave ? Link to comment
Castillo Posted July 27, 2012 Share Posted July 27, 2012 Use the same code but to close it? Link to comment
albers14 Posted July 27, 2012 Share Posted July 27, 2012 Use the same code but to close it? Not really, you putted a timer in you script thats move it back after 2 seconds. If he want todo like you saying then he should remove the timer first Link to comment
Jokeℝ1472771893 Posted July 27, 2012 Author Share Posted July 27, 2012 yes i just need that onMarkerLeav Script Link to comment
albers14 Posted July 27, 2012 Share Posted July 27, 2012 yes i just need that onMarkerLeav Script function EDIT ( hitPlayer, matchingDimension ) -- Need edit if getElementType(hitPlayer) =="player" and isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( hitPlayer ) ), aclGetGroup ( "Admin" ) ) then moveObject ( gate, 2000, new coords ) -- need edit end end addEventHandler ( "Edit the eventHandler", marker, EDIT!! ) -- Need edit It can take less than 1 minute if you know the coords already else 2 minutes Link to comment
Jokeℝ1472771893 Posted July 28, 2012 Author Share Posted July 28, 2012 this is onMarkerLeave? O_o Link to comment
Guest Guest4401 Posted July 28, 2012 Share Posted July 28, 2012 this is onMarkerLeave? O_o Yes. Link to comment
albers14 Posted July 28, 2012 Share Posted July 28, 2012 this is onMarkerLeave? O_o If you edit the places where I said you shoul then yes. As event handler you use onMarkerLeave. Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 it's not working Link to comment
Castillo Posted August 2, 2012 Share Posted August 2, 2012 Try this: local gate = createObject ( 980, 1128.3000488281, -1541.0999755859, 16.10000038147, 0, 0, 180 ) local marker = createMarker ( 1128.3000488281, -1543.5999755859, 13.300000190735, "cylinder", 2, 255, 255, 255, 255 ) function moveGate ( hitPlayer, matchingDimension ) if ( getElementType ( hitPlayer ) == "player" ) and isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( hitPlayer ) ), aclGetGroup ( "Admin" ) ) then if ( eventName == "onMarkerHit" ) then moveObject ( gate, 2000, 1118, -1541.0999755859, 16.10000038147 ) setTimer ( moveBack, 2000, 1 ) elseif ( eventName == "onMarkerLeave" ) then moveBack ( ) end end end addEventHandler ( "onMarkerHit", marker, moveGate ) addEventHandler ( "onMarkerLeave", marker, moveGate ) function moveBack ( ) moveObject ( gate, 2000, 1128.3000488281, -1541.0999755859, 16.10000038147 ) end Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 nope it's closed again after 6-8 sec Link to comment
Castillo Posted August 2, 2012 Share Posted August 2, 2012 It works perfectly here, when enter marker -> gate opens, when leave marker -> gate closes. Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 no no try to stand and don't move Link to comment
Castillo Posted August 2, 2012 Share Posted August 2, 2012 That's because of the 2 seconds timer the script has: setTimer ( moveBack, 2000, 1 ) remove that and done. Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 thnx it's work now 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