ramzi Posted December 20, 2014 Posted December 20, 2014 Hi guys,i have this gate code works fine but the gates open when i be far from them,how can i make the distance to open them so near?plz help me. gate1 = createObject (980, -13.60, 2067.30,19, 0,0,90 ) gatecol = createColCircle (-13.60, 2067.30,19,12.5,10 ) local className = "Army" function OpenGates (thePlayer) if ( getTeamName(getPlayerTeam(thePlayer)) == "Army" ) then moveObject (gate1,2000,-13.60,2067.30, 24.799 ) end end addEventHandler( "onColShapeHit", gatecol, OpenGates ) function CloseGates (thePlayer) if ( getTeamName(getPlayerTeam(thePlayer)) == "Army" ) then moveObject (gate1,2000,-13.60, 2067.30,19 ) end end addEventHandler( "onColShapeLeave", gatecol, CloseGates )
Saml1er Posted December 20, 2014 Posted December 20, 2014 CreateColCircle has only 3 arguements. Syntax colshape createColCircle ( float fX, float fY, float radius ) So it should be createColCircle ( X , Y, radius ) I hope this helps. EDIT: All you need to do is createColCircle (-13.60, 2067.30, 19) -- Now decrease 19
Enargy, Posted December 20, 2014 Posted December 20, 2014 you can also use createMarker ( float x, float y, float z, "cylinder" float size, 0, 0, 0, 255 ) -- change the alpha value to 0 to be invisible You can use the addEventHandler as input to the element. addEventHandler("onMarkerHit", marker, FUNCTION_NAME) -- server or if isElementWithinMarker ( element , marker ) then -- if the element is within the marker --- FUNCTIONS end
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