font = renderCreateFont('Cactus', 6, 4)
function rkact()
enabled = not enabled
sampAddChatMessage(enabled and '{FFFFFF}[{FFAD40}WH{FFFFFF}] - [{4FFF38}Enable{FFFFFF}]' or '{FFFFFF}[{FFAD40}WH{FFFFFF}] - [{FF1C1C}Disable{FFFFFF}]', -1)
end
function main()
while not isSampAvailable() do wait(0) end wait(1)
wait(1300)
sampAddChatMessage("{FFFFFF}[{FFAD40}Resource Render by Quarter] - {FF4A4A}ACTIVATED",-1)
sampRegisterChatCommand("rwh", rkact)
while true do
wait(0)
if enabled then
for handle, v in pairs(getAllObjects()) do
local asd
if sampGetObjectSampIdByHandle(v) ~= -1 then
asd = sampGetObjectSampIdByHandle(v)
end
if isObjectOnScreen(v) then
local result, oX, oY, oZ = getObjectCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(oX,oY,oZ)
local objmodel = getObjectModel(v)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
distance = string.format("%.0f", getDistanceBetweenCoords3d(oX,oY,oZ, x2, y2, z2))
if objmodel == 3930 then renderDrawLine(x10, y10, x1, y1, 2, 0xFFFFFF) renderFontDrawText(font,"{FFFF00}Resource:FF0000}"..distance, x1, y1, -1) end
end
end
end
end
end
function rkact()
enabled = not enabled
sampAddChatMessage(enabled and '{FFFFFF}[{FFAD40}WH{FFFFFF}] - [{4FFF38}Enable{FFFFFF}]' or '{FFFFFF}[{FFAD40}WH{FFFFFF}] - [{FF1C1C}Disable{FFFFFF}]', -1)
end