Jump to content

Dead7ucky

Members
  • Posts

    13
  • Joined

  • Last visited

Details

  • Occupation
    none

Recent Profile Visitors

933 profile views

Dead7ucky's Achievements

Square

Square (6/54)

1

Reputation

  1. Вообщем суть проблемы в следующем: Машины в гараже не перекрашиваются,стикеры не клеятся. Пробовал разные модели, разбирал Txd файлы, ошибок в дебаге нет. Незнаю уместно ли. Но может кто знает , ктото юзал этот мод. Вообщем интересно будет услышатьрешение проблемы.
  2. Поставил мод на сервер - 31.131.31.147:22003 Может кто глянет и поймет в чем собсна дело.
  3. @koragg I send you PM
  4. Он то из гитхаба и взят. Проблема скорее всего кроется в ресурсе dpAssest. Я с этой проблемой написал и в Англоязычную ветку. ВОТ ТУТ. Там мне немного помогли. Но на последнее сообщение так и не ответили. Можете взглянуть на эту тему. Я уже немного отчаялся на решение этой проблемы =(
  5. Fonts located is here : \dpAssets\assets\fonts
  6. Now I know for sure that the problem in the exports.lua script. Due to incorrect imports, there is no text everywhere where the font Roboto-Regular.ttf is used
  7. Maybe you're downloading this mod and see for yourself what the problem is? Mod Located on GITHUB
  8. Yes in meta.xml It is declared In other scripts everywhere similar warnings
  9. And also I think that this Warning Affects my problem. Warning:dpAssetst\client\exports.lua:33:Error creating font @ 'dxCreateFont' [assest/Fonts/Roboto-Regular.ttf] FULL CODE (EXPORTS.LUA) All Fonts are in the folder. local ASSETS_PATH = "assets/" local SHADERS_PATH = "shaders/" local TEXTURES_PATH = "textures/" local FONTS_PATH = "fonts/" local cache = { textures = {}, shaders = {}, fonts = {} } local function setupElementParent(element, resource) if not element or not resource then return false end element.parent = getResourceDynamicElementRoot(resource) return true end function createShader(name, ...) local element = dxCreateShader(ASSETS_PATH .. SHADERS_PATH .. tostring(name), ...) setupElementParent(element, sourceResource) return element end function createTexture(name, ...) local element = dxCreateTexture(ASSETS_PATH .. TEXTURES_PATH .. tostring(name), ...) setupElementParent(element, sourceResource) return element end function createFont(name, ...) local element = dxCreateFont(ASSETS_PATH .. FONTS_PATH .. tostring(name), ...) setupElementParent(element, sourceResource) return element end function createShaderCached(name, ...) if not name then return false end if cache.shaders[name] then return cache.shaders[name] end cache.shaders[name] = createShader(name, ...) setupElementParent(cache.shaders[name], sourceResource) return cache.shaders[name] end function createTextureCached(name, ...) if not name then return false end if cache.textures[name] then return cache.textures[name] end cache.textures[name] = createTexture(name, ...) setupElementParent(cache.textures[name], sourceResource) return cache.textures[name] end function createFontCached(name, ...) if not name then return false end if cache.fonts[name] then return cache.fonts[name] end cache.fonts[name] = createFont(name, ...) setupElementParent(cache.fonts[name], sourceResource) return cache.fonts[name] end
  10. Here is the complete code CarshopMenu = {} local renderTarget local MENU_OFFSET = Vector3(-7.5, -7, -0.7) local position = Vector3() local size = Vector2(1.5, 1.9) local rotation = 280 local resolution = size * 250 local headerHeight = 70 local barOffset = 20 local barHeight = 20 local labelHeight = 50 local barsList = { {locale = "carshop_label_speed", value = 0.7, param = "speed"}, {locale = "carshop_label_acceleration", value = 0.4, param = "acceleration"}, {locale = "carshop_label_control", value = 0.85, param = "control"} } local headerFont local labelFont local hasDriftHandling = false local themeColor = {0, 0, 0} local themeColorHex = "#FFFFFF" local function draw() dxSetRenderTarget(renderTarget) dxDrawRectangle(0, 0, resolution.x, resolution.y, tocolor(42, 40, 41)) dxDrawRectangle(0, 0, resolution.x, headerHeight, tocolor(32, 30, 31)) local priceText = "" if Carshop.currentVehicleInfo.price > 0 then priceText = "$" .. tostring(Carshop.currentVehicleInfo.price) else priceText = exports.dpLang:getString("price_free") end dxDrawText(priceText, 0, 0, resolution.x - 20, headerHeight, tocolor(themeColor[1], themeColor[2], themeColor[3]), 1, labelFont, "right", "center") local priceWidth = dxGetTextWidth(priceText, 1, labelFont) local headerText = Carshop.currentVehicleInfo.name local hearderWidth = dxGetTextWidth(headerText, 1, headerFont) local hearderScale = math.min(1, (resolution.x - 60 - priceWidth) / hearderWidth) dxDrawText(headerText, 20, 0, resolution.x - 20 - priceWidth, headerHeight, tocolor(255, 255, 255), hearderScale, headerFont, "left", "center", true) local buyButtonActive = true local buyButtonText = exports.dpLang:getString("carshop_buy_button") if Carshop.currentVehicleInfo.level > localPlayer:getData("level") then buyButtonActive = false --"Требуется уровень " .. buyButtonText = string.format(exports.dpLang:getString("carshop_required_level"), tostring(Carshop.currentVehicleInfo.level)) elseif Carshop.currentVehicleInfo.price > localPlayer:getData("money") then buyButtonActive = false buyButtonText = exports.dpLang:getString("carshop_no_money") end if not buyButtonActive then dxDrawRectangle(0, resolution.y - headerHeight, resolution.x, headerHeight, tocolor(32, 30, 31)) dxDrawText(buyButtonText, 20, resolution.y - headerHeight, resolution.x, resolution.y, tocolor(255, 255, 255, 150), 1, headerFont, "center", "center") else dxDrawRectangle(0, resolution.y - headerHeight, resolution.x, headerHeight, tocolor(themeColor[1], themeColor[2], themeColor[3])) dxDrawText(buyButtonText, 20, resolution.y - headerHeight, resolution.x, resolution.y, tocolor(255, 255, 255), 1, headerFont, "center", "center") end local y = headerHeight local barWidth = resolution.x - barOffset * 2 for i, bar in ipairs(barsList) do -- Подпись dxDrawText(bar.text, 0, y, resolution.x, y + labelHeight, tocolor(255, 255, 255), 1, labelFont, "center", "center") y = y + labelHeight dxDrawRectangle(barOffset, y, barWidth, barHeight, tocolor(65, 65, 65)) dxDrawRectangle(barOffset, y, barWidth * bar.value, barHeight, tocolor(themeColor[1], themeColor[2], themeColor[3])) bar.value = bar.value + (Carshop.currentVehicleInfo.specs[bar.param] - bar.value) * 0.2 y = y + barHeight * 2 end local labelText = exports.dpLang:getString("carshop_drift_label") local valueText = "" if Carshop.hasDriftHandling then valueText = exports.dpLang:getString("carshop_drift_label_yes") else valueText = exports.dpLang:getString("carshop_drift_label_no") end dxDrawText(labelText .. ": " .. themeColorHex .. valueText, 0, y, resolution.x, y + labelHeight, tocolor(255, 255, 255), 1, labelFont, "center", "center", false, false, false, true) dxSetRenderTarget() local halfHeight = Vector3(0, 0, size.y / 2) local rad = math.rad(rotation) local lookOffset = Vector3(math.cos(rad), math.sin(rad), 0) dxDrawMaterialLine3D( position + halfHeight, position - halfHeight, renderTarget, size.x, tocolor(255, 255, 255, 250), position + lookOffset ) end function CarshopMenu.start(basePosition) position = MENU_OFFSET + basePosition renderTarget = dxCreateRenderTarget(resolution.x, resolution.y, false) headerFont = exports.dpAssets:createFont("Roboto-Regular.ttf", 20) labelFont = exports.dpAssets:createFont("Roboto-Regular.ttf", 18) themeColor = {exports.dpUI:getThemeColor()} themeColorHex = tostring(exports.dpUtils:RGBToHex(unpack(themeColor))) for i, bar in ipairs(barsList) do bar.text = exports.dpLang:getString(bar.locale) end addEventHandler("onClientRender", root, draw) end function CarshopMenu.stop() if isElement(renderTarget) then destroyElement(renderTarget) end if isElement(headerFont) then destroyElement(headerFont) end if isElement(labelFont) then destroyElement(labelFont) end removeEventHandler("onClientRender", root, draw) end
  11. I have a problem in the script. Error attempt to perform arithmetic on local ''priceWidth" (a boolean value) string local hearderScale = math.min(1, (resolution.x - 60 - priceWidth) / hearderWidth)
  12. У меня ошибка в одном из скриптов. Дебаг показал: attempt to perform arithmetic on local ''priceWidth" (a boolean value) Сама строка: local hearderScale = math.min(1, (resolution.x - 60 - priceWidth) / hearderWidth) Уже который день мучусь помогите решить данную проблему. Вместо priceWidth Вставлял разные числа. эфекту 0
×
×
  • Create New...