Jump to content

Restricted Cars


v0nz

Recommended Posts

Yes this is possible. Here's a very abstract example to give you an idea how it could be done.

  
setElementParent(theVehicle, theTeam) -- make theTeam owner of this vehicle 
  

  
function onVehicleStartEnter(enteringPlayer, seat, jacked) 
  if (getElementParent(source) ~= getPlayerTeam(enteringPlayer)) then -- check if the player is entering a car that is owned by his or her team 
    cancelEvent() -- if not prevent the player from entering the vehicle 
  end 
end 
  

This is one way of doing it. You should however take note that cancelling the onVehicleStartEnter is bugged in DP2. Somehow you can only cancel the event once.

Link to post
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...