Drakath Posted February 1, 2014 Share Posted February 1, 2014 Is there a function to return a list of players who are in a vehicle you have specified? Link to comment
manawydan Posted February 1, 2014 Share Posted February 1, 2014 try this function getPlayersInVehicle(model) local t ={} for k,v in ipairs(getElementsByType("player")) do if isPedInVehicle(v) then if (getElementModel(getPedOccupiedVehicle(v)) == model) then table.insert(t,v) end end end return t end Link to comment
Castillo Posted February 1, 2014 Share Posted February 1, 2014 Are you talking about a vehicle element or a vehicle model? if it's an element, then you can use: getVehicleOccupants 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