abdalbaset Posted January 3, 2014 Posted January 3, 2014 i got problem with moving gate its didnt move whene i get in the marker and i am in the team object = createObject(980,2754, 1312,13,0,0,90) marker = createMarker(2754, 1312,12, "cylinder", 2, 100, 0, 0, 100) function gateo ( player ) local team = getPlayerTeam ( player ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == "Assassins" ) then moveObject ( object, 2740, 1312,13, -5 ) end end addEventHandler ( "onMarkerHit", root, gateo ) function gatec ( player ) moveObject ( object, 2754, 1312,13, 1.3999999761581 ) end addEventHandler ( "onMarkerLeave", root, gatec )
Plean Posted January 3, 2014 Posted January 3, 2014 (edited) object = createObject(980, 2754, 1312, 13, 0, 0, 90) marker = createMarker(2754, 1312,12, "cylinder", 2, 100, 0, 0, 100) function gateo ( hitElement ) if getElementType( hitElement ) == "player" then local team = getPlayerTeam ( hitElement ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == "Assassins" ) then moveObject ( object, 2000, 2754, 1312, 8 ) end end end addEventHandler ( "onMarkerHit", marker , gateo ) function gatec ( leftElement ) moveObject ( object, 2000, 2754, 1312, 13 ) end addEventHandler ( "onMarkerLeave", marker , gatec ) Edited January 3, 2014 by Guest
abdalbaset Posted January 3, 2014 Author Posted January 3, 2014 its not working o can just see objects but its not moving
50p Posted January 3, 2014 Posted January 3, 2014 Triple posting is not acceptable. Use Edit button next time please. Thank you.
abdalbaset Posted January 3, 2014 Author Posted January 3, 2014 i made another copy to make it for another gate but if i enter the marker nothing move whene i leave it its going to unknown location object = createObject(980, 2827, 1382.8994140625, 12.5, 0, 0, 0) marker = createMarker(2827, 1382.8994140625, 10, "cylinder", 2, 100, 0, 0, 100) function gateop ( hplayer ) if source == marker then if getElementType( hplayer ) == "player" then local team = getPlayerTeam ( hplayer ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == "Assassins" ) then moveObject ( object, 2827, 1382.8994140625, 6 ) end end end end addEventHandler ( "onMarkerHit", root, gateop ) function gatecl ( lplayer ) if source == marker then moveObject ( object,2827, 1382.8994140625, 12.5 ) end end addEventHandler ( "onMarkerLeave", root, gatecl )
Drakath Posted January 3, 2014 Posted January 3, 2014 That means your coordinates are wrong. Change the moveObject coordinates.
TAPL Posted January 3, 2014 Posted January 3, 2014 The second argument of the function moveObject is the time that the object will arrive the position.
Gallagher Posted January 3, 2014 Posted January 3, 2014 Look checkGateMarker = createMarker ( 216.22926330566, 1875.0806884766, 7.4616560935974, "corona", 10.0, 0, 0, 255, 0 ) function onPoliceShapeHit ( thePlayer, matchingDimension ) if ( getElementType ( thePlayer ) == "player" ) then outputChatBox ( "You have entered Police Base zone!", thePlayer, 0, 0, 255 ) end end addEventHandler ( "onColShapeHit", policeColShape, onPoliceShapeHit ) function createGate () gatePolice = createObject ( 976, 209.8828125, 1875.8419189453, 12.372331619263 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) moveObject ( gatePolice, 976, 218.11740112305, 1875.3406982422, 12.372331619263 ) end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function onLeave ( thePlayer, matchingDimension ) setTimer ( movingBackPolice, 3000, 1, thePlayer ) end addEventHandler ( "onMarkerLeave", checkGateMarker, onLeave ) function movingBackPolice () moveObject ( gatePolice, 3000, 209.8828125, 1875.8419189453, 12.372331619263 ) end https://community.multitheftauto.com/ind ... ls&id=2060
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