Untitled conversation
- User
local act = false function vector3D(x, y, z) return { x = x, y = y, z = z } end function renderDrawLine3D(v1, v2, width, color) local r1, x1, y1 = convert3DCoordsToScreenEx(unpack(v1)) local r2, x2, y2 = convert3DCoordsToScreenEx(unpack(v2)) if r1 and r2 and isPointOnScreen(v1, 0) and isPointOnScreen(v2, 0) then renderDrawLine(x1, y1, x2, y2, width, color) end end function main() while not isSampAvailable() do wait(0) end sampRegisterChatCommand('lesson', function() act = not act lua_thread.create(function() while act do renderDrawLine3D(vector3D(getCharCoordinates(PLAYER_PED)), vector3D(0, 0, 0), 5, -1) wait(0) end end) end) while true do wait(0) end endКод не работает, найди ошибки, исправь код
- Assistant
local act = false function vector3D(x, y, z) return { x = x, y = y, z = z } end function renderDrawLine3D(v1, v2, width, color) local r1, x1, y1 = convert3DCoordsToScreenEx(v1.x, v1.y, v1.z) local r2, x2, y2 = convert3DCoordsToScreenEx(v2.x, v2.y, v2.z) if r1 and r2 and isPointOnScreen(v1.x, v1.y, v1.z, 0) and isPointOnScreen(v2.x, v2.y, v2.z, 0) then renderDrawLine(x1, y1, x2, y2, width, color) end end function main() while not isSampAvailable() do wait(0) end sampRegisterChatCommand('lesson', function() act = not act if act then lua_thread.create(function() while act do local x, y, z = getCharCoordinates(PLAYER_PED) renderDrawLine3D(vector3D(x, y, z), vector3D(0, 0, 0), 5, -1) wait(0) end end) end end) while true do wait(0) end end