LucasBaker Posted July 15, 2013 Share Posted July 15, 2013 local meuMarker = createMarker ( x, y, z, "cylinder", 1, 255, 0, 0, 100 ) function celtonX ( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) createVehicle ( 432, ..elementType.. ) end addEventHandler( "onMarkerHit", meuMarker, MarkerHit ) Well I'm trying to create a script when the player go through the marker it will appear with the vehicle id 432 but I think you missed this line createVehicle ( 432, ..elementType.. ) could someone help me? Link to comment
Tete omar Posted July 15, 2013 Share Posted July 15, 2013 local meuMarker = createMarker ( 0, 0, 3, "cylinder", 1, 255, 0, 0, 100 ) function celtonX ( hitElement ) if ( getElementType( hitElement ) == "player" ) then local x, y, z = getElementPosition ( hitElement ) createVehicle ( 432, x, y, z ) end end addEventHandler ( "onMarkerHit", meuMarker, celtonX ) Change marker coordinates to where you want. Link to comment
Castillo Posted July 15, 2013 Share Posted July 15, 2013 local meuMarker = createMarker ( x, y, z, "cylinder", 1, 255, 0, 0, 100 ) function celtonX ( hitElement, matchingDimension ) if ( getElementType ( hitElement ) == "player" ) then if ( not isPedInVehicle ( hitElement ) ) then local x, y, z = getElementPosition ( hitElement ) local vehicle = createVehicle ( 432, x, y, z ) warpPedIntoVehicle ( hitElement, vehicle ) else local vehicle = getPedOccupiedVehicle ( hitElement ) setElementModel ( vehicle, 432 ) end end end addEventHandler ( "onMarkerHit", meuMarker, MarkerHit ) 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