BOMB
help optimize dudeunknown
lua
4 years ago
3.2 kB
12
Indexable
function showDXTiles()
if (not isInsideArea) then
return false
end
if (boost) then
dxDrawText("BOOSTED", (sX - 406) / 2, (sY - 108) / 2, ((sX - 406) / 2) + 406, ( (sY - 108) / 2) + 108, tocolor(255, 0, 0, 51), 5.00, "default", "center", "center", false, false, false, false, false)
end
dxDrawRectangle((sX - width) / 2, (sY - 720), width, 26, tocolor(255, 255, 255, 255), false)
if (table.size(tiles) == 0) then return false end
local whatleft = cells-table.size(tiles)
rW = howManyColor(owned, "red")
gW = howManyColor(owned, "green")
bW = howManyColor(owned, "blue")
yW = howManyColor(owned, "yellow")
piW = howManyColor(owned, "pink")
puW = howManyColor(owned, "purple")
brW = howManyColor(owned, "brown")
grW = howManyColor(owned, "grey")
orW = howManyColor(owned, "orange")
blW = howManyColor(owned, "black")
liW = howManyColor(owned, "lime")
cyW = howManyColor(owned, "cyan")
local addWidth = rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + puW*5 + brW*5 + grW*5 + orW*5 + blW*5 + liW*5 + cyW*5
for i, v in pairs(tiles) do
local x, y, z = getElementPosition(v)
local z = z+1.55
dxDrawMaterialLine3D(x+4.5, y, z-0.95, x-4.5, y, z-0.95, dot, 9, colors[owned[tiles[tostring(i)]]], false, x, y, z)
--dxDrawTextOnElement(v, "Tiles "..tostring(i)..", "..tostring(math.ceil(x))..", "..tostring(math.ceil(y)), 1, 160, 0, 0, 0,255, 2,"arial")
end
dxDrawRectangle((sX - width) / 2, (sY - 720), rW*5, 26, colors["red"], false)
dxDrawRectangle(rW*5 + (sX - width) / 2, (sY - 720), gW*5, 26, colors["green"], false)
dxDrawRectangle(rW*5 + gW*5 + (sX - width) / 2, (sY - 720), bW*5, 26, colors["blue"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + (sX - width) / 2, (sY - 720), yW*5, 26, colors["yellow"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + (sX - width) / 2, (sY - 720), piW*5, 26, colors["pink"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + (sX - width) / 2, (sY - 720), puW*5, 26, colors["purple"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + puW*5 + (sX - width) / 2, (sY - 720), brW*5, 26, colors["brown"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + puW*5 + brW*5 + (sX - width) / 2, (sY - 720), grW*5, 26, colors["grey"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + puW*5 + brW*5 + grW*5 + (sX - width) / 2, (sY - 720), orW*5, 26, colors["orange"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + puW*5 + brW*5 + grW*5 + orW*5 + (sX - width) / 2, (sY - 720), blW*5, 26, colors["black"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + puW*5 + brW*5 + grW*5 + orW*5 + blW*5 + (sX - width) / 2, (sY - 720), liW*5, 26, colors["lime"], false)
dxDrawRectangle(rW*5 + gW*5 + bW*5 + yW*5 + piW*5 + puW*5 + brW*5 + grW*5 + orW*5 + blW*5 + liW*5 + (sX - width) / 2, (sY - 720), cyW*5, 26, colors["cyan"], false)
end
addEventHandler("onClientPreRender", root, showDXTiles)Editor is loading...