Jump to content

Give Vehicle on special team


Gtagasje

Recommended Posts

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
  
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...