local get_avatar = function(steamid)
local huy = nil
local counter = 4
local rgba_image = {}
local huy = nil
local handle = native_ISteamFriends_GetSmallFriendAvatar( native_ISteamFriends , tonumber(steamid:sub(4, -1)) + 76500000000000000ULL)
local image_bytes = ""
if handle > 0 then
local width = uintbuffer(1)
local height = uintbuffer(1)
if native_ISteamUtils_GetImageSize(native_ISteamUtils, handle, width, height) then
if width[0] > 0 and height[0] > 0 then
local rgba_buffer_size = width[0]*height[0]*4
local rgba_buffer = charbuffer(rgba_buffer_size)
if native_ISteamUtils_GetImageRGBA(native_ISteamUtils, handle, rgba_buffer, rgba_buffer_size) then
local png = begin(width[0] , height[0] , "rgba")
for x =0 , width[0]-1 do
for y =0, height[0]-1 do
local pizda = x*(height[0]*4) + y*4
png:write { rgba_buffer[pizda] , rgba_buffer[pizda+1] , rgba_buffer[pizda+2] , rgba_buffer[pizda+3]}
end
end
huy = png.output
end
end
end
elseif handle ~= -1 then
huy = nil
end
function transform(input)
local output = string.format("%x", input ) -- "7F"
return ("\\x" .. string.upper(output))
end
if not huy then return end
for i=1 ,#huy do
image_bytes= image_bytes..huy[i]
end
local image_loaded = Render.LoadImage(image_bytes , Vector2.new(12,12))
return image_loaded
end