function main()
while not isSampAvailable() do wait(0) end
while true do
wait(0)
local gun = getCurrentCharWeapon(1)
if isCharOnFoot(1) and (isKeyDown(0x01) or isKeyDown(0x11)) and not (isKeyDown(0x02) or isKeyDown(0x14)) and (gun == 32 or gun == 28) then
local mypos = {getCharCoordinates(1)}
local x, y, z = getOffsetFromCharInWorldCoords(1, 0, 128, 0.4)
local result, tPoint = processLineOfSight(mypos[1], mypos[2], mypos[3] + 0.4, x, y, z + 0.4, true, true, true, true, false, true, false, false)
local targetPos = result and tPoint.pos or {x, y, z + 0.4}
local _, sw, sh, cz = convert3DCoordsToScreenEx(targetPos[1], targetPos[2], targetPos[3])
if cz > 4 then
renderDrawPolygon(sw, sh, 10, 10, 8, 0, 0xFF606060)
renderDrawPolygon(sw, sh, 8, 8, 8, 0, 0xFFFFFFFF)
end
end
end
end