function getAllCharsInVehicles()
local players = {}
for i = 0, sampGetMaxPlayerId(true) do
if sampIsPlayerConnected(i) and not sampIsPlayerNpc(i) then
local result, ped = sampGetCharHandleBySampPlayerId(i)
if result and isCharInAnyCar(ped) then
local _, id = sampGetPlayerIdByCharHandle(ped)
table.insert(players, sampGetPlayerNickname(id))
end
end
end
end