around 800 red
around 2000 yellow
around 3100 green
(those values are very important to decide if buy or not)
function updateHudtxt(id,pl) 	local x, y = player(pl,'x') - player(id,'x') + 320, player(pl,'y') - player(id,'y') + 200 	local c 	if player(pl,"money") >= 3100 then 		c = "©000255000" 	elseif player(pl,"money") >= 2000 and player(pl,"money") < 3100 then 		c = "©255255000" 	else 		c = "©255000000" 	end 	parse('hudtxt2 '..id..' '..pl..' "'..c..'$'..player(pl,'money')..'" '..x..' '..y..' 1') end
------------------------------------------ -- Show Money for PCS by Gajos (#18271) -- ------------------------------------------ gajos = {} gajos.huds = {} for i = 1,32 do gajos.huds[i] = {} end addhook('startround','gajos.startround',42) function gajos.startround() local freezeTime = tonumber(game('mp_freezetime')) or 0 if freezeTime > 1 then gajos.tableLiving = player(0,'tableliving') for _, id in pairs(gajos.tableLiving) do for _, pl in pairs(gajos.tableLiving) do if player(id,'health') > 0 and player(pl,'health') and player(id,'team') == player(pl,'team') and id ~= pl then updateHudtxt(id,pl,x,y) table.insert(gajos.huds[id],pl) end end end addhook('buy','gajos.buy',42) timer((freezeTime - 1) * 1000,'removeHudtxts') end end function gajos.buy(pl) for _, id in pairs(gajos.tableLiving) do if player(id,'team') == player(pl,'team') and id ~= pl and gajos.containUser(pl) then timer(50,'parse','lua updateHudtxt('..id..','..pl..')') end end end function gajos.containUser(pl) 	for _, id in pairs(gajos.tableLiving) do 		if id == pl then 			return true 		end 	end 	return false end function updateHudtxt(id,pl) local x, y = player(pl,'x') - player(id,'x') + 320, player(pl,'y') - player(id,'y') + 200 parse('hudtxt2 '..id..' '..pl..' "©000255000$'..player(pl,'money')..'" '..x..' '..y..' 1') end function removeHudtxts() freehook('buy','gajos.buy') for _, id in pairs(gajos.tableLiving) do for k, i in pairs(gajos.huds[id]) do parse('hudtxtalphafade '..id..' '..i..' 1000 0') end gajos.huds[id] = {} end gajos.tableLiving = nil end