WalkeeR Posted November 25, 2020 Share Posted November 25, 2020 local playerMoney = getPlayerMoney (localPlayer) local messages = {} local sx, sy = guiGetScreenSize () addEventHandler ("onClientRender", root, function () local tick = getTickCount () if (playerMoney ~ = getPlayerMoney (localPlayer)) then local pM = getPlayerMoney (localPlayer) if (pM> playerMoney) then local diff = pM - mesa playerMoney . insert (messages, {diff, true, tick + 5000, 180}) else local diff = playerMoney - pM table.insert (messages, {diff, false, tick + 5000, 180}) end playerMoney = pM end if (#messages > 7) então table.remove (messages, 1) end for index, data in ipairs (messages) faz local v1 = dados [1] local v2 = dados [2] local v3 = dados [3] local v4 = dados [4] dxDrawRectangle (sx - 220, (sy-20) - (índice * 25), 200, 20, tocolor (0, 0, 0, v4)) if (v2) then dxDrawText ("+ $" .. convertNumber (v1), sx - 200, (sy-18) - (índice * 25), 50, 20, tocolor (0, 255, 0, v4 + 75), 1, 'default-bold') else dxDrawText ("- $" .. convertNumber (v1), sx - 200, (sy-18) - (índice * 25), 50, 20, tocolor (255, 0, 0, v4 + 75), 1, 'negrito padrão') end if (tick> = v3) then messages [index] [4] = v4-2 if (v4 <= 25), em seguida, table.remove (mensagens,índice) fim fim fim fim) function convertNumber (number) local formatted = number enquanto true do formatted, k = string.gsub (formatted, "^ (-?% d +) (% d% d% d)", '% 1,% 2') if ( k == 0) então quebra fim fim volta fim formatado Link to comment
Administrators Tut Posted November 25, 2020 Administrators Share Posted November 25, 2020 Thread moved to the Portuguese forum for best results Link to comment
ber Posted November 26, 2020 Share Posted November 26, 2020 Crie um export para isso, usar um onClientRender que roda 24h sem evento para ativação não é nada legal para o desempenho do servidor. Link to comment
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