-- Честно спиздил мерцание иконки из ответа chromiusj
local ffi = require('ffi')
ffi.cdef [[
typedef int BOOL;
typedef unsigned long HANDLE;
typedef HANDLE HWND;
HWND GetActiveWindow(void);
BOOL FlashWindow(HWND hWnd, BOOL bInvert);
]]
function main()
while not isSampAvailable() do wait(100) end
wait(-1)
end
function onReceivePacket(ID, BS)
if(ID == 220) then
raknetBitStreamIgnoreBits(BS, 8)
if(raknetBitStreamReadInt8(BS) == 17) then
raknetBitStreamIgnoreBits(BS, 32)
local str = raknetBitStreamReadString(BS, raknetBitStreamReadInt32(BS))
if(str:find("window%.executeEvent%(%'event%.az%-banner%.initializeBannerInfo")) then
window = ffi.C.GetActiveWindow()
ffi.C.FlashWindow(window, true)
end end end end