local sampev = require('samp.events')
local stream = {}
function sampev.onPlayerStreamIn(playerId)
local result, handle = sampGetCharHandleBySampPlayerId(playerId)
if result then
table.insert(stream, handle)
end
end
function sampev.onPlayerStreamOut(playerId)
stream[playerId] = nil
end
print(#stream) -- кол-во игроков
for k, handle in pairs(stream) do -- пример
print(select(2, sampGetPlayerIdByCharHandle(handle)))
end