Estevam2d Posted September 24, 2014 Share Posted September 24, 2014 How do I do to open the gate with game time? but also it has to be in the team; Sorry bad english... local gate = createObject(980, 1447.200, 663.869, 11.98, 0, 0, 179) local marker = createMarker(1447.5, 664.255, 10.672, "cylinder", 11, 255, 255, 255, 0) function moveGate(hitPlayer) if getElementType(hitPlayer) == "player" then local theTeam = getPlayerTeam(hitPlayer) if theTeam and getTeamName(theTeam) == "Policia Militar" or getTeamName(theTeam) == "BMV - Staff" then moveObject(gate, 2500, 1427.89, 664.042, 11.98) end end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack(leavePlayer) if getElementType(leavePlayer) == "player" then local theTeam = getPlayerTeam(leavePlayer) if theTeam and getTeamName(theTeam) == "Policia Militar" or getTeamName(theTeam) == "BMV - Staff" then moveObject(gate, 2500, 1447.200, 663.869, 11.98) end end end addEventHandler("onMarkerLeave", marker, moveBack) Link to comment
XFawkes Posted September 24, 2014 Share Posted September 24, 2014 local hour, minutes = getTime() if (hour >= 6 and hour < 12) or (hour >= 19 and hour < 22) then --another if's -- code end It will allow the gate to move between 6:00 and 11:59 or 19:00 and 21:59 Link to comment
Estevam2d Posted September 24, 2014 Author Share Posted September 24, 2014 but What I Really Want And How to open the Gate Hours Played. type: local sValue = getElementData( source,'PlayTime' ) if not sValue then sValue = '0:0:0' end Link to comment
#DRAGON!FIRE Posted September 24, 2014 Share Posted September 24, 2014 local sHour = split( getElementData( source, 'PlayTime' ), ":" ) local hour = tonumber( sHour[1] ) Link to comment
Estevam2d Posted September 24, 2014 Author Share Posted September 24, 2014 someone help me this not working. function moveGate(hitPlayer) if getElementType(hitPlayer) == "player" then local theTeam = getPlayerTeam(hitPlayer) local sHour = split( getElementData( hitPlayer, 'PlayTime' ), ":" ) local hour = tonumber( sHour[1] ) if not sHour then sHour = '300:0:0' end if theTeam and getTeamName(theTeam) == "R.O.T.A" or getTeamName(theTeam) == "BMV - Staff" then moveObject(gates, 2500, 1509.664, 663.894, 11.98) end end end addEventHandler("onMarkerHit", markerr, moveGate) 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