Gtagasje Posted October 14, 2011 Share Posted October 14, 2011 I have created a give vehicle marker, but I wan't it to only work when the team is "Police". I don't know how to do this.. I tried several things, but the most logic for me is this: local vehicleMarker = createMarker(1552.33, -1605.37, 12.5, 'cylinder', 2.0, 0, 0, 255, 150 ) function vehicleMarkerHit ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and if getElementTeam ( hitElement ) == "Police" then local vehicle = createVehicle ( 596, 1552.33, -1605.37, 13, 0, 0, 180 ) warpPedIntoVehicle(hitElement, vehicle) end end end addEventHandler( "onMarkerHit", vehicleMarker , vehicleMarkerHit ) Can somebody please help me? Link to comment
bandi94 Posted October 14, 2011 Share Posted October 14, 2011 local vehicleMarker = createMarker(1552.33, -1605.37, 12.5, 'cylinder', 2.0, 0, 0, 255, 150 ) function vehicleMarkerHit ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) ==getTeamFromName( "Police") then local vehicle = createVehicle ( 596, 1552.33, -1605.37, 13, 0, 0, 180 ) warpPedIntoVehicle(hitElement, vehicle) end end addEventHandler( "onMarkerHit", vehicleMarker , vehicleMarkerHit ) 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