Nelson Posted July 3, 2013 Share Posted July 3, 2013 (edited) Hello.I'm Nelson, an other MTA new scripter.I need some help with a gate system.I'm here till now function createTheGate () gate1 = createObject ( 2938, 984.8, 1480.7, 14.6 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function openMyGate ( ) moveObject ( gate1, 2938, 984.8, 1480.7, 16.6 ) setTimer ( movingMyGateBack, 5000, 1 ) end getPlayerTeam ( ThePlayer, openMyGate ) function movingMyGateBack () moveObject ( gate1, 2938, 984.8, 1480.7, 14.6 ) end can anyone help me? Edited July 3, 2013 by Guest Link to comment
HunT Posted July 3, 2013 Share Posted July 3, 2013 onClientMarkerHit getPlayerTeam Open the gate onClientMarkerLeave Close the gate https://wiki.multitheftauto.com/wiki/OnClientMarkerHit https://wiki.multitheftauto.com/wiki/On ... arkerLeave Link to comment
Nelson Posted July 3, 2013 Author Share Posted July 3, 2013 Well, i just want to close a place with gate and to open only with teams. Link to comment
#Al-Ha[J]aRii Posted July 3, 2013 Share Posted July 3, 2013 Well, i just want to close a place with gate and to open only with teams. are you want to do when you come near gate open and when you left gate close ? if that you want your code wil be like this : Server Side : addEventHandler ( "onResourceStart", resourceRoot, function ( ) gate1 = createObject ( 2938, 984.8, 1480.7, 14.6 ) Marker = createMarker ( 2938, 984.8, 1480.7, 14.6, "corona", Size, 0, 0, 255, 0 ) end ) function moveGate(player) local PlayerTeam = getPlayerTeam ( player ) local TeamN = getTeamFromName ( "TeamName" ) if isElementWithinMarker ( player, Marker ) then if PlayerTeam == TeamN then moveObject ( gate1, 2938, 984.8, 1480.7, 16.6 ) end end end addEventHandler("onMarkerHit",Marker, moveGate) function moveBack() moveObject ( gate1, 2938, 984.8, 1480.7, 14.6 ) end addEventHandler("onMarkerLeave",Marker,moveBack) about the replace in code : put size for marker line 4 for the size from player to gate wil open and GoodLuck . Link to comment
Nelson Posted July 3, 2013 Author Share Posted July 3, 2013 well, i did it.Thanks all for helping me. I'm requested to lock this topic. /lock!!! 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