Spajk Posted November 9, 2013 Posted November 9, 2013 (edited) This should do the trick: function getUnoccupiedSeats(vehicle) local seats = {} local maxp = getVehicleMaxPassengers(vehicle) for i = 0, maxp-1 do if(not getVehicleOccupant(vehicle, i))then table.insert(seats, i) end end if(#seats > 0)then return seats else return false end end Edited November 9, 2013 by Guest
Castillo Posted November 9, 2013 Posted November 9, 2013 https://wiki.multitheftauto.com/wiki/Ge ... eOccupants That function also returns the occupants.
glowdemon1 Posted November 23, 2013 Posted November 23, 2013 Didn't test the function spaijk made but this should work if you ofcourse add spaijk's function. for a,b in pairs(getUnoccupiedSeats(vehicle)) do outputChatBox("Unoccupied seats : " ..b) end
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